Y
Yes2man
I am using DLookup to find date fields in a table. One date field is
formatted as short date (i.e. 01/01/1900) and the other is in general date
format (i.e. 01/01/1900 10:00:00 PM) but has user entries that both have the
time and don't have the time. I have tried the following code:
DLookup("[TSI]", "Calendar of Events: All Events", "[Begin Date] = #" &
startdate1 & "# AND [TSI] = '" & rndtsi & "'")
where startdate1 represents a variable (a date) based on user input (short
date format) and rndtsi is a variable representing the name of the individual
I am looking for. The code works fine when there is an exact match between
[Begin Date] and startdate1 (when both are in the short date format), but
when the entry in [Begin Date] is in general date format (has the time),
DLookup misses it! I've tried to use Format and also tried using the 'Like'
operator in the DLookup, but I can't get it right.
Any help would be greatly appreciated!
formatted as short date (i.e. 01/01/1900) and the other is in general date
format (i.e. 01/01/1900 10:00:00 PM) but has user entries that both have the
time and don't have the time. I have tried the following code:
DLookup("[TSI]", "Calendar of Events: All Events", "[Begin Date] = #" &
startdate1 & "# AND [TSI] = '" & rndtsi & "'")
where startdate1 represents a variable (a date) based on user input (short
date format) and rndtsi is a variable representing the name of the individual
I am looking for. The code works fine when there is an exact match between
[Begin Date] and startdate1 (when both are in the short date format), but
when the entry in [Begin Date] is in general date format (has the time),
DLookup misses it! I've tried to use Format and also tried using the 'Like'
operator in the DLookup, but I can't get it right.
Any help would be greatly appreciated!