Results 1 to 5 of 5
  1. #1
    RachelBedi is offline Advanced Beginner
    Windows Vista Access 2003
    Join Date
    Jul 2012
    Posts
    67

    Unhappy Run Append Query at Specific Time


    I am ready to tear my hair out :-(

    I am trying desperately to get my access db to run a macro called "AuditTenPercent" at a specific time.

    I set up a hidden form which opens when the DB is open - in the on current event I want it to check the time on the system - if the system time is equal to say 9:00 I want it to open my macro AuditTenPercent which is an append query.

    Can someone help PLEASE?!

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    I wouldn't suggest doing this, unless the machine you're running this is ONLY running your timer. If it's a machine that's actually being used for other purposes this is not a great idea, timers in access literally check the clock time every x seconds and it can really bog down your performance.

    It's not an ideal solution, but you could set up a separate database with a form and the ON OPEN event of that form is to run your query, then close the database. Then you can set up a scheduled task to run that on the schedule you actually need. I think it may also be possible to run the database in this mode in a non-visible window but it's been a long time since I had to do anything like this.

  3. #3
    RachelBedi is offline Advanced Beginner
    Windows Vista Access 2003
    Join Date
    Jul 2012
    Posts
    67
    would it be possible to set up a vb module which checks the system time and then call that module from the hidden form?....

  4. #4
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    you're asking the same question really. With any timer function in vb (access) your database has to check the system clock every x seconds to see what time it is. It can not (to my knowledge) say 'ok system clock is 9:00 am so I'm running this). It has to check and check and check until it find the situation met, then run. Then it will continue running (unless you stop it at a certain time and start it at a certain time manually or with code every morning) so let's say you come in at 8:30 AM and you want it to 'automatically' update at 9:00 AM you would start a timer that would check every 5 or 10 seconds to see if it's greater than or equal to 9:00 AM. On the first event of it being after 9:00 AM you can have it perform it's update than maybe cancel the time checker, but no matter what you do timers in access are resource hogs.

    Here's a thread using the TIMER function

    http://www.vbforums.com/showthread.p...very-x-seconds

  5. #5
    RachelBedi is offline Advanced Beginner
    Windows Vista Access 2003
    Join Date
    Jul 2012
    Posts
    67
    you're right I asked the same question sorry lol

    Seems my only solution is to set it up in a different DB and have task scheduler on my machine open it and run the macro as a specific time. Annoying BUT better than telling my boss that someone has to click the button every am.

    Thank you!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Calculating age during a specific time frame
    By mommaof4kids in forum Reports
    Replies: 1
    Last Post: 09-06-2012, 06:08 PM
  2. Replies: 1
    Last Post: 06-15-2012, 05:51 PM
  3. Replies: 10
    Last Post: 04-17-2012, 10:29 AM
  4. Dividing time by a specific number
    By harrig04 in forum Queries
    Replies: 1
    Last Post: 07-05-2011, 09:09 AM
  5. Append Query: Time Stamp
    By AKQTS in forum Programming
    Replies: 3
    Last Post: 08-16-2010, 12:34 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums