iankerry
Registered User.
- Local time
- Today, 14:42
- Joined
- Aug 10, 2005
- Messages
- 190
Hi
I have a continuous form with 600 records with dates in it, some past dates some future dates.
When the form loads I want it to go to todays date, or the nearest date before today if there isnt a todays date.
The code i use at the moment is:
dtmBestDate = DMin("[DateField]", "[dbo_eventsflicks]", "[DateField] >= #" & date & "#")
Datefield is the field in the record that holds the date of an event
dbo_eventflicks is the table name.
it sometimes works, but if there isnt a todays date or a date for yesterday for examply it just goes to the first record.
Can anyone suggest an amendment for me that will help?
many thanks
ian
I have a continuous form with 600 records with dates in it, some past dates some future dates.
When the form loads I want it to go to todays date, or the nearest date before today if there isnt a todays date.
The code i use at the moment is:
dtmBestDate = DMin("[DateField]", "[dbo_eventsflicks]", "[DateField] >= #" & date & "#")
Datefield is the field in the record that holds the date of an event
dbo_eventflicks is the table name.
it sometimes works, but if there isnt a todays date or a date for yesterday for examply it just goes to the first record.
Can anyone suggest an amendment for me that will help?
many thanks
ian