Results 1 to 6 of 6

Thread: 'Search Record

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2002
    Location
    Pilipinas
    Posts
    441

    'Search Record

    I have tried this code to search a record.

    Dim aa As String
    aa = InputBox("Enter a Employee No.", "Find Employee No.")
    DataSet11.Tables("Employee").Rows.Find("empno='" & aa & "'")

    But this code doesnt work! In my records, there are Employee No. which is 001.
    I typed 001 into the InputBox but it doesn't work.
    Any solution do you have. Or Is there another way to Search records in Database using Dataset?

  2. #2
    Addicted Member
    Join Date
    Oct 2002
    Posts
    145
    hi,

    have you already found a solution for this?

    marivic

  3. #3
    Lively Member
    Join Date
    Nov 2002
    Location
    Malaysia
    Posts
    124

    Use Sql

    DataAdapter1.SelectCommand.CommandText = & _
    "SELECT * FROM Employee WHERE " & _
    "ID = ' " & aa & "' " & _
    DataAdapter1.Fill(DataSet11)

  4. #4
    Addicted Member
    Join Date
    Oct 2002
    Posts
    145
    Hi,

    What I wanted is to be able to scroll the datagrid to position the cursor to the found code. Please tell me how to accomplish this?

    Many thanks.

  5. #5
    Lively Member
    Join Date
    Nov 2002
    Location
    Malaysia
    Posts
    124
    Originally posted by Marivic
    Hi,

    What I wanted is to be able to scroll the datagrid to position the cursor to the found code. Please tell me how to accomplish this?

    Many thanks.
    I don't really understand what you meant by "scroll the datagrid to position the cursor to the found code"

  6. #6
    Addicted Member
    Join Date
    Oct 2002
    Posts
    145
    Hi,

    I have a datagrid bound to a table. What I wanted is upon inputting the emp code and pressing enter (this is using inputbox), the datagrid would be able to scroll for the cursor to position to where the emp code is located otherwise display 'no record found'.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width