Results 1 to 4 of 4

Thread: .Find two fields

  1. #1

    Thread Starter
    Fanatic Member eimroda's Avatar
    Join Date
    Jul 2000
    Location
    Philippines
    Posts
    642

    .Find two fields

    How can I use the .Find method using 2 fields?

    For a single field (Field), this is how to do it:
    VB Code:
    1. RS.Find "Field = '" & value

    HOw about if Im going to search in two fields? I used AND but Vb complained. Please help.
    On Error GoTo Hell

    Hell:
    Kill Me


    Food For Thought:

    - Do not judge a book... if you're not a judge!


  2. #2
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343
    You can't.


    At least not like that.
    Use the Where clause for multiple field searches, although this will mean a filtered recordset...


    Vince

    BOFH Now, BOFH Past, Information on duplicates

    Feeling like a fly on the inside of a closed window (Thunk!)
    If I post a lot, it is because I am bored at work! ;D Or stuck...
    * Anything I post can be only my opinion. Advice etc is up to you to persue...

  3. #3
    Swatty
    Guest
    You can filter on the recordset
    VB Code:
    1. RS.Filter = "Field = '"  & value & '" AND Field2 = '" & value2 & "'"

    I see you placed a qoute before the value and not after it.
    If it is a string your searching on you have to place it between a single qoute.

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    Use SQL and you can search on as many fields as you want.

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