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.
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 & "'"