Results 1 to 7 of 7
  1. #1
    OnatGG is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Jul 2012
    Posts
    4

    How to Run Access Macro in certain times

    Hello there !

    I have my data updated 3 certain times in a day. So i dont want to bother opening the same access 3 times a day. That access can be opened whole day no problem for me. So could u please tell me how to run macros automatically in a time which i determine before ? Thank you !

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    If it was me, I'd create a db that ran your macro when it opened (autoexec) then closed itself. Then I'd call that db from Windows Scheduled Tasks at the appropriate times. If you want to leave the db open, you'd use the timer event of the form and test for the time (it would probably require VBA code). I don't like that because the code is basically always running. I'm stingy with my processor's time.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    OnatGG is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Jul 2012
    Posts
    4
    unfourtanently i dont have Windows Scheduled Tasks in my computer. My company doesnt allow it. I thought about a similiar solution like yours already but its no use to me Thx anyway.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    That seems odd, since it's not really risky in itself. In any case, you use the timer event of the form as mentioned. You probably want form level variables to keep track of whether you've run the process for a particular time, depending on how you test the time. Dive in and post back if you get stuck.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    qa12dx is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Nov 2012
    Location
    india
    Posts
    112
    use ontimer to close and then open the form. in form on load set your queries to run.
    made a quick db. have the time set for 2 seconds. i run the event using time difference betwen 3 seconds. too late in the night to give details, but it is pretty straight forward, maynot be the best way, but here it is for what it worth.

    have a look. hope it helps
    Attached Files Attached Files

  6. #6
    OnatGG is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Jul 2012
    Posts
    4
    i was on vacation so sorry for late reply. i think ur db is great ! thanks for that ! im a bit newb at access so it ll take some time for me to convert my regular work to this db but its ok since you did what i need. thank you !!

  7. #7
    qa12dx is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Nov 2012
    Location
    india
    Posts
    112
    cool!

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

Similar Threads

  1. Replies: 3
    Last Post: 08-07-2012, 09:19 AM
  2. Replies: 2
    Last Post: 05-05-2012, 02:34 AM
  3. Question about Times in Access Table
    By Littlma in forum Access
    Replies: 1
    Last Post: 08-02-2011, 07:00 AM
  4. Replies: 0
    Last Post: 01-12-2011, 12:43 PM
  5. Access Macro
    By Gargen in forum Access
    Replies: 0
    Last Post: 09-14-2009, 09:13 AM

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