Autofire Macro

  • Thread starter Thread starter Tim
  • Start date Start date
T

Tim

How do you make a macro fire on a given date?

I need to 'skim' some query results that then go into a
table for historic reporting. I've written a macro that
runs SQL to skim the queries and ditch in a table, but I
need this macro to fire on the last day of every month.

Any ideas?

TIA
Tim
 
Tim,

First of all, you need to decide the appropriate event when you want the
macro to run, e.g. when the database is first opened on the last day of
the month. You will be able to put a Condition in the macro which tests
whether it is the last day of the month, for example...
Day(Date()+1)=1
To prevent the macro firing multiple times on the last day of the month,
you may need to have a single field, single record table where you store
the last date when the "skim" was done for example as
Format(Date(),"yymm")
and then run an update query at the end of your macro to reset the valus
of this field. Then, your macro condition will need something like...
Day(Date()+1)=1 And DLookup("[Updated]","Skim")<Format(Date(),"yymm")
 
Back
Top