Results 1 to 3 of 3

Thread: ADO Find Problem

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2000
    Posts
    3
    I'm using ADO with access97 database file. I've read bits and pieces on the find command but I can only get it to work on a few fields. I would like to allow the user to select the field to search on, use wildcards, and the direction. I keep getting arguments are out of range.

    S$ = Search.Combo1
    SearchText$ = Search.Text1

    fMainForm.TData1.Recordset.MoveFirst
    fMainForm.TData2.Recordset.MoveFirst

    fMainForm.TData1.Recordset.Find S$ & "Like" & "'" & SearchText$ & "*'"

    If fMainForm.TData1.Recordset.EOF Then
    MsgBox "Not Found", vbOKOnly
    fMainForm.TData1.Recordset.MoveFirst
    fMainForm.TData2.Recordset.MoveFirst
    Else
    MsgBox "Found", vbOKOnly
    End If

    The user selects the field from a combo control and then enters a search string.

    Any help would be greatly appreciated,

    Rusty


  2. #2
    Member
    Join Date
    Oct 1999
    Location
    Snellville, GA, USA
    Posts
    38
    Check your spaces in your SQL Statement

    fMainForm.TData1.Recordset.Find S$ & "Like " & "'" & SearchText$ & "*'"

    Notice the space after the word like...

    -Elias

  3. #3

    Thread Starter
    New Member
    Join Date
    Apr 2000
    Posts
    3
    Thanks,

    That worked great!!

    Rusty

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