Ignore the LostFocus event?

lespritdelescalier

Registered User.
Local time
Today, 00:21
Joined
Mar 16, 2015
Messages
50
Hey all,

I am working on an order management system where a user can enter an Order ID into a text field, tab out, and it will load the order. This is done by using the LostFocus event to call a module which loads the order.

It works as intended - I have no problems whatsoever with loading orders. However, when the focus is in the Order ID text field and I click the "Clear" button to clear the form, it loads the order again but does not perform the OnClick action for the clear button.

Is there any way to either:
a) make the clear button persist over the LostFocus event? (preferred)
b) force the OnClick action to clear the form after the LostFocus event fires?

Ideally, when the LostFocus event fires, it could evaluate if the clear button was pressed, but I realize that this event fires before the next action is registered (hence why the OnClick event never fires).

Thanks for any help you can provide!
 
I'm assuming that the order ID must have data in the field when you click the clear button.
1. If the orderID was blank this could be checked in the lost focus event and ignore the lost focus.
2. Or maybe clearing the ID and tabing out would cause call the clear button routine.
3. Maybe you could save the orderID from the last reload and if you loose focus, check the orderID against the saved one and if they're the same, don't do the reload, then the button event would happen.
I am not aware of any way to reorder events and can't think of another way except the ideas above.
 
AfterUpdate event, not LostFocus
 

Users who are viewing this thread

Back
Top Bottom