Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stop Escape key from working?

Status
Not open for further replies.

jhaganjr

IS-IT--Management
Dec 11, 2002
62
US
On a form, by setting KeyPreview to Yes and using the KeyUp, KeyDown or KeyPress events, I can trap a user who presses the Escape key.

I do this so a user cannot avoid the form validations by pressing Escape when the record is dirty. I prompt for their intentions and either wipe out the entry or set the form back to dirty in the code, depending on their response.

However, in the case where they do not want to abandon their entry, and I set the form back to dirty, the Escape press has still wiped out any changes they've made to the record to that point.

Does anyone know how to stop the Escape key from working - either entirely or using code to ignore it? Or maybe to restore field values that have been undone by the Escape key?

Thanks very much.
Joe
 
Have you tried with the special AutoKeys macro ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
KeyCode = 0 ... how easy could it be?

Thanks for getting me over my brain-deadness!

Joe
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top