Open a from on todays Date

mdg

Registered User.
Local time
Today, 10:15
Joined
Feb 17, 2011
Messages
68
I have a form where I need to open it based upon the present date. The query has a date field in it. Each day is one record and cannot be dupicated either. So basically, I want to be able to have the form open and point to either a new record - Now()- and also reopen and point to dDate=Now(). Does this make sense. For example - I open up the form for the first time today and it would open up to a 'new' record since today has not been recored yet. I then close the form and reopen it later today to update todays information and it would open up to today again. I tried different methods in the properties page using a filter and does not work.
THanks for any suggestions
 
Here's the logic:

* have a Date() criteria under the Date field
* open form as usual using the OpenForm command
* test to see whether there are 1 or more records based on today's date (i.e. using the DCount() function), if there are 0 records use DoCmd.Runcommand acCmdRecordsGoToNew
[/code]
 
Thanks for the reply, I will give it a try.
 
And notice that vbaInet used the Date() Function rather than the Now() Function. Now() includes a time as well as date, and will complicate things if you're looking for another record for the current day. It could be done but it's more complicated so simply use Date() when that's all that you need.

Linq ;0)>
 

Users who are viewing this thread

Back
Top Bottom