>>How do I send the FOCUS back to a field from a VALID?
>RETURN .F. or RETURN 0 or RETURN [tabordernextfield of interest]
>It's easy to get trapped in WHEN/VALID now so I try to only got/set/lostfocus and use the lostfocus event for validation and repositioning. Usually any gotfocus() code is ok to prime the field for the user (i.e. reset to empty/null/default this.value stuff)
>HTH
Gary,
Here's my take on When/GotFocus and Valid/LostFocus
WHEN: Decide if the user should be allowed in this control at all (ONLY This do not set up control here)
GOTFOCUS: SEt up control for focus (if this event fires the user is in because they passed the When test)
VALID: Decide if the user will allowed to leave this control (Do NOT react to their leaving here)
LOSTFOCUS: React to the focus leaving this control (because if this event fires they have passed the Valid test)
This is not an either or situation, it is best to make the proper use of all four events. To make proper use one needs to know the event sequence;
Moving to a control:
WHEN If When test is passed ------> GotFocus
If When test failed -------------> When of next control
Moving off of a control:
VALID If Valid test passed --------> LostFocus
If Valid test failed -----------> Focus remains in this control (LostFocus does NOT fire)