Default dates

teiben

Registered User.
Local time
Today, 08:32
Joined
Jun 20, 2002
Messages
462
How is the easiest / best way to accomplish this, I have a database w/many reports. These reports all have a time frame range on them. ="Covers Awarded from " & [Forms]![TimeFrame]![tBeginDate] & " to " & [Forms]![TimeFrame]![tEndDate]. Problem is if the user doesn't select a time frame. How could I set a default tBeginDate and tEndDate? The database opens on a switchboard, so I put the
Me!tBeginDate = DateAdd("d", -1030, Date)
Me!tEndDate = DateAdd("d", 1030, Date)
which doesn't work. How would I declare/create/whatever a startdate and an ending date?
Help would be greatly appreciated.
 
Are you building this option in your query or in VB code?

Easiest way would be to have the form which sets your beginning and ending date use the datediff function in it's default value box. Just set the datediff as you have on the switchboard to be the default value for tBeginDate and tEndDate.
 

Users who are viewing this thread

Back
Top Bottom