Results 1 to 4 of 4
  1. #1
    JeroenMioch's Avatar
    JeroenMioch is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2012
    Location
    Den Haag, Netherlands
    Posts
    368

    Close Access at specific time

    Hi guys,



    I'd like to close my database daily at a certain point in time but im having trouble with this.
    I can do it using the Form_timer but my db has many forms and reports so i'd have to enable that at every form and report. Thus not an option.

    So i tryed making a macro :

    IF TimeValue("19:00") THEN
    <close database>

    It doesnt work at 19:00 so i thought i might have to make it Autoexec but that doesnt work either.
    It only closes the database right away when opened.

    Anyone a clue to achieve this ?

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    In a form, put a text box for the shutdown time...txtShutdownTime

    form property TIMERINTERVAL = 1000 ( 1 second)
    in the ONTIMER event put code

    if format(Time(),"hh:nn:ss") = txtShutdownTime then docmd.quit

  3. #3
    JeroenMioch's Avatar
    JeroenMioch is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2012
    Location
    Den Haag, Netherlands
    Posts
    368
    Quote Originally Posted by ranman256 View Post
    In a form, put a text box for the shutdown time...txtShutdownTime

    form property TIMERINTERVAL = 1000 ( 1 second)
    in the ONTIMER event put code

    if format(Time(),"hh:nn:ss") = txtShutdownTime then docmd.quit
    But if that form is not open, then the shutdown will not occur i guess ?

  4. #4
    NTC is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2009
    Posts
    2,392
    Open a hidden form so that you can guarantee it to be having the timer event.

    the reason that this is not easily accomplished is that the concept of Access fundamentally is that it is 'event driven' i.e. has a user running it. It is not an exe app running on a server. So it is not an ideal vehicle for timed events.

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

Similar Threads

  1. Close one form open another and set focus to a specific field
    By Derrick T. Davidson in forum Programming
    Replies: 12
    Last Post: 08-01-2014, 05:16 AM
  2. Need Msgbox to close after especific time
    By Secue in forum Programming
    Replies: 3
    Last Post: 12-20-2013, 02:10 PM
  3. Replies: 6
    Last Post: 08-13-2013, 09:18 AM
  4. Every time I close or save changes
    By Opid in forum Access
    Replies: 1
    Last Post: 06-18-2012, 07:43 AM
  5. Replies: 0
    Last Post: 11-29-2011, 01:06 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