How can I use the .Find method using 2 fields?
For a single field (Field), this is how to do it:
VB Code:
RS.Find "Field = '" & value
HOw about if Im going to search in two fields? I used AND but Vb complained. Please help.
Printable View
How can I use the .Find method using 2 fields?
For a single field (Field), this is how to do it:
VB Code:
RS.Find "Field = '" & value
HOw about if Im going to search in two fields? I used AND but Vb complained. Please help.
You can't.
At least not like that.
Use the Where clause for multiple field searches, although this will mean a filtered recordset...
Vince
You can filter on the recordset
VB Code:
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.
Use SQL and you can search on as many fields as you want. :)