Disbling Close button for Access

D

Domnic

How to disable the - minimize, restore and close button on the Access Module.
I need to programme my database from the controls on one of my forms only. Is
there a code available?

regards
Domnic
 
N

NevilleT

Hi Domnic

You can use
me.controlbox=false to disable the three buttons. This can also be set in
the properties if you want to have them disabled under all circumstances.
 
J

JimBurke via AccessMonster.com

Just a warning - I do this on all my forms (minimize, restore and close
button). But the user more than likely can still select File, Close from the
menu bar if they want to. I had one customer that did that all the time,
because that's what they were used to doing in Windows. So if you really want
to guarantee that they can only close the form with your button, you can one
of two things (there may be other solutions as well). 1, you can use your own
menu bar or disable the menu bar. 2, you can define a variable in your form
module declarations section to keep track of whether your close button was
used. Set it to false in the Form Open event proc, set it to True in the
Close button event proc. Then create a Form Unload event proc and check to
see if the variable is set to True. If not, issue a message to the user
telling them they must use the form's buttons and cancel the Unload.
 

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