Search for record using 2 fields as criteria

limhodav

New member
Local time
Today, 13:50
Joined
Sep 26, 2005
Messages
6
Hi all,

May I know what is the easiest way to search for records using 2 fields wich are not primary keys? and then return a boolean value whether it is found or not...

These 2 fields are of integer type.

Recordset.Find can only find record with one field and not two.

Is there any codes available for this?

Thaks a million in advance
 
You could use DCOUNT or a FUNCTION.
DCOUNT("PrimaryKeyCol","TableName","Field1 = " & SomeNumber & " AND Field2 = '" & SomeString & "'"
As an example
 
Thanks .... I found a easy way but til now i received syntax or data type error ....

Here's the code .... maybe someone can help me ??? the problem lies in where u should put the quotes " "

rst.FindFirst "AttendeeID =" & Me!AttendeeID And "EventID = " & Me!EventID

It works if I hard code it like this
rst.FindFirst AttendeeID=1 And EventID=3
 
lim,

Look at FoFa's syntax:

rst.FindFirst "AttendeeID = " & Me.AttendeeID & " And EventID = " & Me.EventID

Wayne
 

Users who are viewing this thread

Back
Top Bottom