M
Mike
Is there a way to disable the enter key (~ or {ENTER})?
Graham Mandeno said:Hi Mike
I'm not absolutely certain it will work, because I think the Enter key might
be intercepted before the KeyDown event, but you could try this:
Private Sub Form_KeyDown( KeyCode as Integer, Shift as Integer )
If KeyCode = vbKeyEnter Then KeyCode = 0
End Sub
You must also set the KeyPreview property of the form to Yes.
AAMOI, why do you want to do this?
--
Good Luck
Graham Mandeno [Access MVP]
Auckland, New Zealand
Mike said:Is there a way to disable the enter key (~ or {ENTER})?
Mike said:No help. I have several message boxes that the user can click ok to. However
if they use the enter key and hold it down the message boxes are ran through
rapidly and the user is no seeing what the message box is trying to tell
them. By disabeling the enter key, they are forced to click OK rather than
holding down the enter key.
Graham Mandeno said:Hi Mike
I'm not absolutely certain it will work, because I think the Enter key might
be intercepted before the KeyDown event, but you could try this:
Private Sub Form_KeyDown( KeyCode as Integer, Shift as Integer )
If KeyCode = vbKeyEnter Then KeyCode = 0
End Sub
You must also set the KeyPreview property of the form to Yes.
AAMOI, why do you want to do this?
--
Good Luck
Graham Mandeno [Access MVP]
Auckland, New Zealand
Mike said:Is there a way to disable the enter key (~ or {ENTER})?
Chris O''Neill said:Mike said:No help. I have several message boxes that the user can click ok to. However
if they use the enter key and hold it down the message boxes are ran through
rapidly and the user is no seeing what the message box is trying to tell
them. By disabeling the enter key, they are forced to click OK rather than
holding down the enter key.
You can't do this with the MsgBox or InputBox built-in functions, but you
could create your own pop-up "message box" forms with no OK button and then
put code into the Timer Event to close the form after so many seconds. I
can't help you with that code, but I remember there being a post in just the
last couple of days about this very thing, so a quick search would probably
find it for you.
However....
Nothing you can do will get the user to "see" the messages if they don't
want to see them. You can throw up roadblocks (disabled enter key, timer
events, etc.), but if a user isn't interested in what you have to tell them
they'll just ignore it no matter what you do. This is especially true if
there are alot of message boxes being thrown at them. They might look at the
first and even the second one, but by the third one they'll be bored with the
game and will mentally wander somewhere else.
I would suggest that you look at your program as if you are one of the
users. Analyze the information you're trying to get across. Is it really
all that important? If so, what's the best way to present it so that you get
the user's attention and get the message across? Finally, try and keep the
amount of message boxes and other pop-ups to a minimum.
Hope that helps...
Regards, Chris
Graham Mandeno said:Hi Mike
I'm not absolutely certain it will work, because I think the Enter key might
be intercepted before the KeyDown event, but you could try this:
Private Sub Form_KeyDown( KeyCode as Integer, Shift as Integer )
If KeyCode = vbKeyEnter Then KeyCode = 0
End Sub
You must also set the KeyPreview property of the form to Yes.
AAMOI, why do you want to do this?
--
Good Luck
Graham Mandeno [Access MVP]
Auckland, New Zealand
Is there a way to disable the enter key (~ or {ENTER})?