Ctrl+F4

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How do I disable the Ctrl+F4 keys, I want to prevent the user from closing
any Forms using these keys.

Thanx!
 
Create a macro named AutoKeys.

In the MacroNames column (View menu if you don't see it), enter:
^{F4}
and then specify a harmless action such as Beep.

The more fundmental question is what you are aiming to achieve here. If you
are trying to prevent a user from closing a form, you would also need to
handle Alt+F4, the application close button, File | Close, File | Exit, and
so on. Would it achieve your purpose to put some code into the BeforeUpdate
event of the form, so that you can manage any changes to the data before the
form is closed?
 
Allen, I am trying to prevent the user from using any short cut keys to close
any of the database forms. I want them to use the close button on each form
to close the form.
 
Allen, it's perfect!
--
Thanx!


Allen Browne said:
Create a macro named AutoKeys.

In the MacroNames column (View menu if you don't see it), enter:
^{F4}
and then specify a harmless action such as Beep.

The more fundmental question is what you are aiming to achieve here. If you
are trying to prevent a user from closing a form, you would also need to
handle Alt+F4, the application close button, File | Close, File | Exit, and
so on. Would it achieve your purpose to put some code into the BeforeUpdate
event of the form, so that you can manage any changes to the data before the
form is closed?
 
Presumably you have a *reason* for wanting the hobble the user in this way.
(I have a personal dislike for software that forces users to work in one
particular way: it generally indicates that the developer did not understand
how to handle events properly.)

In any case, if you are using a command button to close forms, you need to
know that there is a serious data-loss bug in Access, where it just silently
throws away the user's entry without any warning if there is a problem with
the entry (e.g. a required field missing, validation rule not met, duplicate
index issue, etc.)

This is a major problem in Access, leading people to mistrust the software.
They know they entered something, but later it's not there. I can't believe
we can't get this fixed after 12 years in Access. More info:
http://allenbrowne.com/bug-01.html
 
Back
Top