Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run Report 1

Status
Not open for further replies.

yont11

IS-IT--Management
Apr 13, 2006
19
AU
I have two reports which I want run automatically when I start my database. Once these reports are run I don't want them to run again on the same day if I exit the database and then start the database again. The code will have to be date based I believe and placed in the openform event in my start up form. Can anyone suggest some code to achieve this. Thanks.
 
Simply have a table storing the last date the reports are run.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
PHV can you point me in the right direction on the code to achieve this? Thanks.
 
Say you have a table (tblLastRun) with a single row and a single field (dteLastRun).
In the Open event procedure of your startup form:
If DLookUp("dteLastRun", "tblLastRun") < Date Then
DoCmd.RunSQL "UPDATE tblLastRun SET dteLastRun=Date()"
DoCmd.OpenReport ...
End If

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top