How to stop the Enter key being used?

JAy3k1

Registered User.
Local time
Today, 08:17
Joined
Mar 12, 2011
Messages
14
I'm having issues with the enter key on my form.

On the last field, which is a date field if the user hits the enter key to confirm the date it automatically move the selection to my delete entry button on the top of the screen.

And if the enter key is hit again the new entry gets deleted without a prompt! Being in a multiuser environment this is just a nightmare! I have changed the enter key function in the menu, which works but this effects other databases running, so no good.

I've also changed the Tab Stop to no which has no effect. also I have tried changing the enter key behavior to New line, but this just make another line when hit in the field and makes the entry invalid.

The last thing I tried was some Keydown code I found on here, but I don't know how to use that on my form/field. When I look at all my code it all starts with Private and not Public?

Code:
Public Function DisableKeys(KeyCode As Integer)
    Select Case KeyCode
        Case vbKeyReturn
            KeyCode = 0
    End Select
End Function

This is driving me nuts. Lol I would post an image but I don't have 10 posts yet.
 
...On the last field, which is a date field, if the user hits the enter key to confirm the date ...
Before we address this could you explain the above statement? How/why, exactly, does hitting <Enter> 'confirm' the date entered? This seems rather unusual! Perhaps a better approach would be, in the date control's AfterUpdate event, to pop up a Messagebox asking for confirmation of the date.

Linq ;0)>
 
Sorry missinglinq. I have to cater for people that are very bad with computers. The field allows you to enter the date manually or pick from the pop-up date box and I know that people will.use the enter key when moving through the fields and noticed the issue if the enter key was pressed. :(

ttp://i53.tinypic.com/25uh1z8.jpg

Add the H to that link..
 
Office Button > Access Options > Advanced > Move After Enter > choose from Don't Move | Next Field | Next Record
 
Also note that you can change the button properties (tab stop => No ) so that user can never arrive at the button by tabbing or hitting Enter.

Chris
 
Thanks for the reply vbaInet, but I cannot use that feature as it effects other databases running on the system. The solution has to be specific to my form as opposed to general settings. :)
 
Also note that you can change the button properties (tab stop => No ) so that user can never arrive at the button by tabbing or hitting Enter.

Chris

Your a star stopher, I changed all the buttons to tab no. Except the Save Entry button so if the user does press enter twice all it does is save the entry. :)

Thank you. :)
 

Users who are viewing this thread

Back
Top Bottom