Schedule Access Macro to Run Weekly

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rd3Po
    New Member
    • Dec 2015
    • 9

    Schedule Access Macro to Run Weekly

    I have created a macro in Access 2010 that pulls equipment due for inspection in the next 14 days and emails the report to two of our employees. I'd like to either: 1. Make this macro auto run every Monday at 9 am or, 2. Make it auto run when there is equipment due in 14 days (and not email if there are none due in 14 days). The DB will be open because I have very little desire to fool with Windows Task Scheduler at this point. I could be persuaded if that is a better option and easy to set up (I have 0 experience with writing scripts in Task Scheduler).

    Thanks,
    Me
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32645

    #2
    Originally posted by rd3Po
    rd3Po:
    The DB will be open because I have very little desire to fool with Windows Task Scheduler at this point.
    That seems a very strange comment. Certainly makes little sense to me. What would cause it to open if not the scheduler?

    If you're interested, I did an article a while ago that helps you handle such stuff - Invoking a Database From the Command Line.

    Comment

    • rd3Po
      New Member
      • Dec 2015
      • 9

      #3
      NeoPa... Thanks for your reply. If the DB is open already (it would be open throughout the day every weekday) then there's no reason that I can think of to run a Task Scheduler script. I will review your article and determine if it's an option I want to proceed with.

      Comment

      • NeoPa
        Recognized Expert Moderator MVP
        • Oct 2006
        • 32645

        #4
        In that case you'd want a Timer routine to be triggered every specified duration and it should check the date and time every time it's triggered and run once it's reached the appropriate time.

        To ensure it doesn't run twice for the same time you should save the value of when it actually runs the process. This should be used to compare with the current time to ensure it's not just run it seconds before.

        How you set the .TimerInterval is down to you.

        Comment

        Working...