Share via

Close a database at a certain time

Anonymous
2017-06-26T20:07:51+00:00

I would like to force a front end to shut down at 11:50pm every night so that our automated compacting can run on the back end at 11:59pm.

Thanks in advance.

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

8 answers

Sort by: Most helpful
  1. Anonymous
    2017-07-13T16:11:47+00:00

    Is a timer interval of 3,600,000 the equivalent of one hour?

    Was this answer helpful?

    0 comments No comments
  2. ScottGem 68,830 Reputation points Volunteer Moderator
    2017-07-12T20:23:30+00:00

    I would say check it every 15 minutes. And I probably would extend the time.

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2017-07-12T19:31:34+00:00

    I think I need some additional help.

    I rewrote your code like this:

    Private Sub Form_Timer()

    'this form is my switchboard which is always open

    If (Time() > #3:30:00 AM#) And (Time() < #4:00:00 AM#) Then

        DoCmd.OpenForm "MaintenanceWarning"

        Pause (3)

        Application.Quit

    End If

    End Sub

    I am telling network administrators to set the compact to run at around 3:45ish.

    Question: How often do I need to set the timer interval?  My head has officially exploded trying to calculate this :-0

    And I don't want to unnecessarily tax the system by checking too frequently.  And do I need to set a larger time span, like 4:30am instead of 4:00am to accommodate this?

    Thanks in advance (and probably after, as well!)

    Was this answer helpful?

    0 comments No comments
  4. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  5. ScottGem 68,830 Reputation points Volunteer Moderator
    2017-06-26T20:23:38+00:00

    I do this with one of my apps:

    Private Sub Form_Timer()

    If (Time() >= #7:00:00 PM#) Then

        DoCmd.OpenForm "frmTimeClose"

    End If

    End Sub

    This checks to see if the time is after 7PM. The time interval can be set to check however frequently you want where 1 sec = 1000. It then opens frmtimeClose which displays a message that the app will close down, then 1 minute later it closes.

    Was this answer helpful?

    0 comments No comments