Results 1 to 3 of 3

Thread: adodc search help

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2012
    Posts
    14

    adodc search help

    Hi!
    I add a search the Adodc in my program with a combo box category,
    but when i run the program and search...
    the category "ID" not searching..

    this is my codes
    Code:
    Private Sub Command1_Click()
    If Text1.Text = "" Then
    MsgBox "Type To Search"
        Else
        If Combo1.Text = "ID" Then
        Form2.Adodc1.Recordset.Filter = "ID='" & Text1.Text & "'"
        Else
        If Combo1.Text = "Surname" Then
        Form2.Adodc1.Recordset.Filter = "Surname='" & Text1.Text & "'"
        Else
        If Combo1.Text = "First Name" Then
        Form2.Adodc1.Recordset.Filter = "FirstName='" & Text1.Text & "'"
        Else
        If Combo1.Text = "Middle Name" Then
        Form2.Adodc1.Recordset.Filter = "MiddleName='" & Text1.Text & "'"
        End If
        End If
        End If
    End If
    End If
    what can i do..
    i need help urgent..

    thanks..

  2. #2
    Hyperactive Member Lenggries's Avatar
    Join Date
    Sep 2009
    Posts
    353

    Re: adodc search help

    What datatype is the ID column?

  3. #3
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,205

    Re: adodc search help

    Sounds like the ID column is numeric in which case you need to loose the 's
    Code:
    Form2.Adodc1.Recordset.Filter = "ID=" & Text1.Text

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