If you set the form's KeyPreview property to Yes, you could use the KeyDown
event to trap the Tab and Enter keystokes and destroy them with:
KeyCode = 0
The more important question might be why you want to do this, e.g.:
1. If you need to prevent the user moving out of a control until you have
validated the entry, use the BeforeUpdate event of the control.
2. If you need to check that the user has not left controls blank, set the
field's Required property in table design.
3. If you need to run a comparison between fields or other complex
record-level validation, use the BeforeUpdate event of the *form*.
4. If you wanted to stay with the same record instead of automatically
tabbing to the next one, set the form's Cycle property to Current Record.
Using KeyCode = 0 disables all key input - we just want
Enter and Tab disabled.
Reason for doing this is that we are trying to 're-
train/re-program' 1 user, whose previous database
experience is using a DOS based database, to use the
mouse
Reason for doing this is that we are trying to 're-
train/re-program' 1 user, whose previous database
experience is using a DOS based database, to use the
mouse
<Chuckle> ... and here I am haranguing my students constantly to learn the
keyboard shortcuts and trying to design an application so they can
completely avoid the mouse..
lol...i know exactly what you mean, Fred! <g>
when you have users faced with doing a volume of data entry, it's so hard to
get those who are not experienced in data entry to keep their hands on the
keyboard and stay away from the mouse. i automatically design my forms for
smooth-flowing keyboard data entry - then it drives me crazy to watch users
go to the mouse to click on the next field during data entry, when they
could press Enter or Tab in half a heartbeat and just keep typing! (i did
data entry myself, 8 hours a day for several years, back in the day of
mainframe dummy terminal input.)
It was the absence of the keycodes for Tab and Enter in
Allen's reply which caused the misinterpretation.
For future refernce where can I find a full list of
keycodes?
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.