Access and Close/Quit

G

Guest

Hi All,

I need my user to close the database (& Access) using a button on a form,
not by any other method (there are long, involved and irrelevant reasons why
this is).

I have disabled the close option on each form and disabled the standard menu
bar which has the close and exit options.

The only other method that the user could use is now the red [x] on Access
itself, is there any way i can disable this when my particular database is
open.

Thanks.
 
M

Mr. B

Hi All,

I need my user to close the database (& Access) using a button on a form,
not by any other method (there are long, involved and irrelevant reasons why
this is).

I have disabled the close option on each form and disabled the standard menu
bar which has the close and exit options.

The only other method that the user could use is now the red [x] on Access
itself, is there any way i can disable this when my particular database is
open.

Thanks.

You can hide the "X" by making the following setting in the properties
of your form:

Control Box = No
Min Max Buttons = None
Close Button = No
What's This Button = No

This will remove all of the control at the upper right of your form.

Although not required, I normally also set the border style of the
form to:
Border Style = Dialog

HTH

Mr B
 
G

Guest

As i said i have already disabled the relevant buttons on the form(s).

I need to disable the [X] on Access itself not the form.

Not meaning to be rude but i have posted a number of questions and had
answers where the answerer has not read my post.

Truely, I am grateful for any help but i would appreciate it if people
wouldn't answer without reading the post properly first as it seems to result
in other potential answerers from contributing.

Thanks
 
J

John W. Vinson

The only other method that the user could use is now the red [x] on Access
itself, is there any way i can disable this when my particular database is
open.

Have a form always open (it can be hidden), and trap its Close event. In your
code check to see if your exit button has been pressed (perhaps by setting a
global variable in the button code) and if not, cancel the close. If the form
can't close, the database can't close either.

The user can ctrl-alt-del and terminate the database that way, and you can't
block that - and if you aren't careful to give them a convenient exit path
they durn well will!

John W. Vinson [MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top