Looking to run a Macro only on Mondays

  • Thread starter Thread starter Hole423
  • Start date Start date
H

Hole423

Guest
I am looking to run a MACRO that prints our a report every Monday moring. I am planning on setting up windows scheduler to open the DB at 3AM mondays and I want either some VB code and MACRO to run my MACRO to printout my report when the report opens at this time. My programming skills are very bad, but I already have a working printout macro, but I can't seem to figure out how to auto run that macro on Mondays when the DB is opened.

Thanks
Hole
 
Hi
If you use your scheduler to open the database, then you can do it like this :

Create a new macro, save it as "Autoexec". Click View -> Macro Names and Click View -> Conditions.

Starting from Top left and working across and then down, enter the following :

Code:
Macro Name	Condition				Action

Start		Weekday(Date())=2			RunMacro (Macro Name : Autoexec.EarlyMonday)
							OpenForm (Form Name : YourSwitchboardFormName)
							StopMacro

EarlyMonday	TimeValue(Now())<TimeValue("04:00")	OpenReport (Report Name : YourReportName, view : print)
		...					Quit
							StopMacro
Be sure to use your actual report name where I put YourReportName and your form name where I put YourSwitchboardFormName. The 'actions' inside the brackets are entered into the 'Action Arguments' fields at the bottom of the macro design screen.

HTH, Andrew :)
 

Users who are viewing this thread

Back
Top Bottom