Mutiple criteria in recordset

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

if i'm looking for a value in my table, can i use recordset with multiple
criteria
just know the result? if there is any please tel me.
thanks,
 
If it's a number value:
Rst.FindFirst "[MyField] = " & Forms!MyForm!MyFieldOnForm & " Or [MyField]
= " & Forms!MyForm!MyOtherFieldOnForm

If it's a text value:
Rst.FindFirst "[MyField] = '" & Forms!MyForm!MyFieldOnForm & "' Or
[MyField] = '" & Forms!MyForm!MyOtherFieldOnForm & "'"
 
if i'm looking for a value in my table, can i use recordset with multiple
criteria
just know the result? if there is any please tel me.
thanks,

Yes. The FindFirst operation uses a criterion which is essentially any
valid SQL WHERE clause (without the word WHERE) so it can contain
almost arbitrarily complex criteria (up to the 64KByte limit).

John W. Vinson[MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Access Dcount (multiple criteria) 3
Narrowing query results 16
Is it possible to combine these? 2
Passing multiple criteria to query a table 2
search multiple criteria 0
Excel Need Countifs Formula Help 0
query a recordset 2
Update Query Problem 2

Back
Top