[AccessD] Force Closing the FE

Stuart McLachlan stuart at lexacorp.com.pg
Mon Feb 14 16:21:23 CST 2011


Better to use a timed "message box" which does the actual shutdown so that if someone IS 
in the application, they know what happened.  The simplest way to do that is:

Create a form with a Close button and a label displaying your message that the application is 
about to close.  Set the Timer Interval on that form to something like 10000 msecs. Include 
the following event procedures.

Private Sub btnClose_Click()
DoCmd.Close
End Sub

Private Sub Form_Close()
DoCmd.Quit
End Sub

Private Sub Form_Timer()
DoCmd.Close
End Sub

Then just open the warning  form  as the final step in your main shutdown procedure.  The 
warning will appear for 10 seconds or until the user clicks OK, whichever occurs first. After 
that the application closes itself.

-- 
Stuart

On 14 Feb 2011 at 13:28, Jennifer Gross wrote:

> Thanks Bruce.  The code has a MsgBox that requires a user action.  One
> of the things I want to get around is users leaving the FE open when
> they leave for the day.  I want it to shut down.  Do you see a problem
> with me bypassing the MsgBox and just doing an Application.Quit once
> the timer has expired?
> 
> Jennifer
> 
> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com
> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kovacs,
> Bruce Sent: Monday, February 14, 2011 1:20 PM To: Access Developers
> discussion and problem solving Subject: Re: [AccessD] Force Closing
> the FE
> 
> 
> Typically 60 minutes.  There was one jobsite with a challenged server
> where I went down to 20 minutes, as I recall (this site also had 3
> different FEs hitting the one BE, and with 15 to 20 concurrent users).
>  And I had a very stable office application with only 3 users where I
> went up to 120 minutes.
> 
> 





More information about the AccessD mailing list