Caps/Num lock and close buttons

K

Ken

Hi, does anyone know of some code that will set the Caps
lock on, Num lock on and also disable the Access close
button so the user has to close down by the forms exit
button?

Thanks

Ken
 
M

Michel Walsh

Hi,


One of the possible solution to oblige the user to click on a "button"
rather than on the [x] of the window is to open a form, invisible, at
startup, and, in its Unload event, set Cancel = true.


In a declaration section of the form:


Public AppCanClose As Boolean



In the Unload event:

If not AppCanClose then
Cancel=true
End If



In your "button" to close Access, add a line like:

FORMS!YourHiddenFormName.AppCanClose = True
' note that a public variable in the declaration section of the form
' acts like a read/write property of that form.




before closing the application.




Hoping it may help,
Vanderghast, Access 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