Results 1 to 4 of 4
  1. #1
    AJ_25 is offline Novice
    Windows 10 Access 2010 32bit
    Join Date
    Apr 2018
    Posts
    12

    Automate Query Refresh

    Hi,



    I have a query within Access that I have to manually refresh 3 times per day at set times. Is there anyway I can automate a refresh within Access so the query runs at at these points in time to take away the manual process please?

    It would be good to have this automatically run at 7am, 1pm and 7pm

    Thanks

  2. #2
    Minty is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,001
    Is this an update query ?
    You can really only do this if the database is open, so your options are really to ensure that the copy you want it to run on is on a server that isn't switched off.
    I personally would use a scheduled windows task to open the database, and have a simple database with an auto exec macro that ran the query on open and then shut itself back down.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  3. #3
    AJ_25 is offline Novice
    Windows 10 Access 2010 32bit
    Join Date
    Apr 2018
    Posts
    12
    It is yes. It looks like there are macro buttons which I press to then refresh the query. I just want to avoid having to manually press the button to update the results.

  4. #4
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,954
    There are at least 2 possible approaches
    a) Use code to check the time every hour - form timer event (with interval 3600s) and if hours equal the values you want, run your update query
    b) As described by Minty, use a Windows scheduled task to open the database & run the update query (via a function) at those set times

    The first requires a timer event to be running continually just to be triggered three times a day - not very efficient
    The second method is much better & is an approach I've used successfully for several years e.g. for updating student attendance data from an external database twice a day
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

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

Similar Threads

  1. Macro code: Automate Select Query Sequence
    By Ace2014 in forum Modules
    Replies: 2
    Last Post: 06-13-2014, 09:21 AM
  2. Automate Query Creation
    By dr4ke in forum Queries
    Replies: 8
    Last Post: 07-11-2012, 02:39 AM
  3. Automate Emails from Query - SendObject
    By Kennertoy in forum Access
    Replies: 5
    Last Post: 10-04-2011, 08:50 PM
  4. Replies: 0
    Last Post: 03-15-2011, 07:35 AM
  5. How to automate a access query ... Help me
    By kusamharsha in forum Programming
    Replies: 0
    Last Post: 02-25-2009, 09:44 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