Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2004

    Unanswered: findfirst criteria error in DAO

    I am trying to find redordset in DAO using findfirst methid.
    Whta my query is, I have two listbox and after selecting from them I want to generate criteria which find recordset in database. So, I used and logical operator with two set, but it gives me error. criteria is like this.

    crtr = "empcity like '" & lst1.list(lst1.listindex) & "' and empdiv like '" lst2.list(lst2.listindex) & "'"

    Please help me to find recordset in database with two criteria.


  2. #2
    Join Date
    May 2004
    Without checking the quotes, which is common error, it appear that your code is searching the db for occurances of the value of the selected list index and not the text that appears in the box after you make your selection. Try something like this using the .text property.

    crtr = "empcity like '" & lst1.text & "' and empdiv like '" lst2.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