>>I always thought that the lostfocus fires _after_ the valid event, but I haven't checked it.
>
>You are right,
>
>I only have code in Text1.LostFocus and Text2.When. These are the two firing in different order.
Klas,
If you use the when ONLY to determine if the control can receive focus and the vlaid ONLY to determine if the control can lose focus and use the LostFocus and GotFocus to react to the events, then you should not have any problem with the different firing sequence.
These particular event methods are often misunderstood.
When
Determines if a control may receive focus, returns T to allow focus and F to deny focus.
GotFocus
This event fires after the when has allowed focus to reach the control and before focus gets there. Use it to do anything you need done before the control gets the focus.
Valid
Determines if a control will be allowed to lose focus. Returns .T. to allow focus to mvoe and .F. to disallow focus from moving. It can also return an integer that will control where focus will go, positive integers move focus forward that number in the tab order and negative numbers move backwards in teh tab order, a return of 0 keeps focus in the current control.
LostFocus
Fires after the vlaid has allowed focus to move. Used to react to the event of focus leaving control.
This may be basic information to you but it is worth repeating it every now and then.