MS Access Events

J

Jim

I am having a problem with events in MS Access 2000. I
have a textbox (Text1) and it has an event Text1_LostFocus
(). When the user tabs out or anything like that, the
event fires. No problem here. However, if the user
presses a button, in this case cmdCancel, I don't want the
Text1_LostFocus() to fire.

I thought this would be easy because I could simply set
module level var to FALSE within cmdCancel_Click() to that
Text1_LostFocus() would bypass all its code if var is set
to false.

The problem: The Text1_LostFocus() event is firing before
cmdCancel_Click(). How do I get around this problem?

Thank you.
Jim
 
A

Allen Browne

Naturally, the focus can't move to the button until it leaves the text box.

Can you train your uses to press the <Esc> key twice instead of needing a
button? The first <Esc> undoes any changes to the current control, and the
second key press undoes any other pending changes in the record.
 

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