Esc Key

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
 
A

Allen Browne

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.
 

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.

Ask a Question

Top