Need Help with Finding Records using Criteria

connieharper

Registered User.
Local time
Today, 07:19
Joined
Sep 15, 2000
Messages
17
I haved looked at this strcritera statement until I am blue, literally.

I am trying to find records based on the criteria specified below. This worked fine until I added the third criteria (strCriteria = strCriteria & "AND timeinday=" & Me!tbxTimeIn). Since adding the third criteria, I get a "Syntax Error" message on the rs.findfirst strcriteria command.

I figure I must have something typed wrong but just don't see it. Do you?


strCriteria = "studentid=" & Me!tbxID & " "
strCriteria = strCriteria & "AND Date=Date()" & " "
strCriteria = strCriteria & "AND timeinday=" & Me!tbxTimeIn

rs.FindFirst strCriteria

(I am trying to find records that contain the student ID that is on the form and today's date and the timein value that is on the form.)

Thanks for any help.
 
What is stored in tbxTimeIn? If it is a string, could it be ...
strCriteria = strCriteria &
"AND timeinday='" & Me!tbxTimeIn & "'"
Or if it is a Date then...
strCriteria = strCriteria &
"AND timeinday=#" & Me!tbxTimeIn & "#"
Hope this works
Chris
 

Users who are viewing this thread

Back
Top Bottom