Agree with Bob. After LostFocus event for controls happens after Exit, so you're setting focus for 1 microsecond in Exit code and then LostFocus occurs.
Two things I'd rethink:
- making users dismiss the message box, especially since the check cannot happen until it's dismissed. Just run it an message if there's a problem
- IsNumeric(12a) should raise an error and you have no error handler. IsNumeric(a12) will return True. There's really no need for this test. Use DLookup for whatever value is entered, which will return a valid value or not. It's really that simple I think.
Last edited by Micron; 04-15-2021 at 08:23 AM.
Reason: clarification
The more we hear silence, the more we begin to think about our value in this universe.
Paraphrase of Professor Brian Cox.