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]
 
Back
Top