One way is to have code that runs whenever the database is opened. It
should check the current date, the date the report needs to be run and
the date it was last run (so as not to run it every time the database
opens on the day in question), and run the report if appropriate.
I'd put the code in the Open event of the startup form, and use a record
in a little 'settings' table to store both the date it needs to be run
and the date it was last run:
tblSettings
SettingName - text*
SettingValue - text
with records
SettingName, SettingValue
"NextRunReportX", "2006/30/06"
"LastRunReportX", "2006/31/05"
Then the code would be something like this:
If (Date() => DLookup("SettingValue", "tblSettings", _
"SettingName=""NextRunReport""")) _
And ( _
(DLookup("SettingValue", "tblSettings", _
"SettingName=""NextRunReport""") _
DLookup("SettingValue", "tblSettings", _
"SettingName=""LastRunReport""") _
) Then
'The report needs to run today and hasn't already run today
'so we run it
DoCmd.OpenReport blah blah
'now update the last-run date
CurrentDB.Execute "UPDATE tblSettings " _
"SET SettingValue = '" & Format(Date(), "yyyy/mm/dd") & "' " _
"WHERE SettingName='LastRunReport';", dbFailOnError
End If
It's possible that at the time the startup form opens the database won't
be ready to run the report. In that case, use the Open event to start
the form's timer with a suitable delay, and then use the OnTime event to
launch the code that opens the report.