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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

run queries first day of the month 1

Status
Not open for further replies.

29091967

Technical User
Feb 5, 2008
19
0
0
DK
Hi,

I have an access 2003 database which runs automatically daily reports.
But i have to create monthly queries in the same access database which
must run reports only the first date of the month.
So if the case is first day of the month than the monthly should be executed.
can i this with a VBA code ?

Thank you!
 
So how do you 'automatically' run your daily reports?
Any code?

If so, I am sure it can be modified to run on the first of every month.

Have fun.

---- Andy
 
Hello Andy,

I export the queries with "DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9,"
The function name of the export command i added to the autoexec macro.
When windows scheduler opens the database than the autoexec macro runs the function.
So the "DoCmd code must open some of the queries only the first day of the month.
Is this possible ?

Thank you!
 
If your "windows scheduler opens the database than the autoexec macro runs the function" every day, you may simply add to your function:

Code:
If Day(Date) = 1 Then[green]
   'Today is 1st of the month
   'Do your magic here
   '....[/green]
        
End If

Assuming your function will be run every day, even when 1st of the month is Saturday. or Sunday, or another Holliday.

Have fun.

---- Andy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top