T
TC
You are heading for a nasty "type conversion" error in your date processing.
I don't have Access here to check, but I believe that in your code, it will
convert the date field value to a >string<, and compare that string,
verbatim, to whatever you typed in the textbox. So, for example, "1/1/2003"
would >not< match "1-Jan-2003", even though they are the same date. The code
that you have written there is definitely not very sound.
Instead, use this:
pts.FindFirst "[SDate]=#" & format$(Me![SDate], "mm/dd/yyyy") & "# AND
[STime]=" & me![STime]
This converts the date to a proper date value using the #...# mehod. That
method requires the date to be in US (m/d/y) format, regardless of the date
settings on your PC.
A similar issue might occur with the time comparison, depending on the data
type of the table field, & what you plan to enter into the time textbox. You
have to think this out carefully. Access will do what you SAY - not
necessarly what you EXPECT!
HTH,
TC
I don't have Access here to check, but I believe that in your code, it will
convert the date field value to a >string<, and compare that string,
verbatim, to whatever you typed in the textbox. So, for example, "1/1/2003"
would >not< match "1-Jan-2003", even though they are the same date. The code
that you have written there is definitely not very sound.
Instead, use this:
pts.FindFirst "[SDate]=#" & format$(Me![SDate], "mm/dd/yyyy") & "# AND
[STime]=" & me![STime]
This converts the date to a proper date value using the #...# mehod. That
method requires the date to be in US (m/d/y) format, regardless of the date
settings on your PC.
A similar issue might occur with the time comparison, depending on the data
type of the table field, & what you plan to enter into the time textbox. You
have to think this out carefully. Access will do what you SAY - not
necessarly what you EXPECT!
HTH,
TC