Esc Key

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

Guest

Hi

I have a Cancel Button on the form and want to have it same effect as Esc
Key pressing. I want to ask what method do I need to use for this. I am using
Me.Undo but it is different than Esc. As it doen't bypass the validations and
keep on asking to enter valid data.

R
 
If the text box has invalid data (such as text in a number field, or a
partially entered date) and you then click the command button, Access will
process the data and events in the current control *before* it allows focus
to move to the button and process its Click event. There is therefore
nothing you can write in the button's Click event that will bypass the
checking and processing of the data in the field.

You could avoid that by using a button that is not on the form, such as the
Undo button on the toolbar, but the undo command button on a form is not a
useful concept.
 
Back
Top