MS Access Events

  • Thread starter Thread starter Jim
  • Start date Start date
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
 
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.
 
Back
Top