[AccessD] exiting Access

Dan Waters dwaters at usinternet.com
Sat Jul 10 13:53:26 CDT 2004


One other thing!

This will prevent you from doing a manually initiated repair/compact.  What
I do is have a button titled "Allow Compact/Repair" which resets
GblnAllowClose to True.  Then the user can Compact/Repair themselves.

If you're using Compact On Close, you won't need to have an "Allow
Compact/Repair" button.

Dan

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Susan Harkins
Sent: Saturday, July 10, 2004 1:40 PM
To: 'Access Developers discussion and problem solving'
Subject: RE: [AccessD] exiting Access

OK, clever -- I guess that may be what JC was really referring to -- 

But what if you don't use or want a main form? I really think I've done this
some other way -- but then, maybe not. 

Susan H. 

Susan,

Yes - It's easy!

When your app opens, set a global Boolean variable to False.

	GblnAllowClose = False

In your main form's Unload event, enter the following code:

    If GblnAllowClose = False Then
        Cancel = True
    End If

The above will not allow the main form to close, thus keeping the
application open.

Now put the following code in the Exit button's click event.

	GblnAllowClose = True
	Docmd.Quit

I've used this for a long time, and it works very well.

Dan Waters

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Susan Harkins
Sent: Saturday, July 10, 2004 1:13 PM
To: 'Access Developers discussion and problem solving'
Subject: [AccessD] exiting Access

This ought to be simple, but I'm drawing a total blank -- 
 
Seems like you ought to be able to trap the File Exit and clicking the
application's Close button -- so you can prevent the user from closing the
application before they should. 
 
Susan H. 
--
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

--
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

-- 
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list