Macro that Runs at the begninning of every year

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need a macro that will run at 12:00am on the first of every year. I have
tried using the date and time as a condition in my macro, but it doesn't run.
My users will not be able to go in and change the year to the next year,
either. To add to that, the database may not be open at 12:00am on 1/1/20??
so the macro would need to run as soon as they database opens after 12:00am
on 1/1/20?? but only run one time until the beginning of the next year.

Can anyone help me?
 
Sarah,

You could use either of the following:

1. Set up a scheduled job (in Windows scheduler) to run the macro on
Jan.01; possibly at 03:00 or so, when noone should be in the office, or

2. Make access do it on open: make a simple single field (YearUpdated)
table (tblAnnualUpdates) in your database; use a DMax on the table to
retrieve the max year from the table, compare to Year(Date()) and if
DMax("v","tblAnnualUpdates") < Year(Date())
then run your update macro, and add a new record with the current year
to the table, by running a sinple Append query:
INSERT INTO tblAnnualUpdates( YearUpdated ) SELECT Year(Date())

HTH,
Nikos
 
Thanks. I'll give it a shot. Can I post back to you if I have problems?
--
Sarah Geist
Owner/Chief Instructor
Summit Computer Training Services
260-466-6414
 
Back
Top