In VFP 3.0 you could issue a SetFocus() to change the focus to a different prompt. In 5.0, a new error is genterated. Error 2212 - "Cannot call SetFocus from within a When, Valid, RangeHigh or RangeLow event."
I have worked around this for the most part by moving my code from When & Valid events to GotFocus & LostFocus events. I have one problem left. My forms have the Save button on a toolbar. When the user clicks on Save, or on a navigation button, I need to check for changes and see if they want to save them. The problem is that the data entered in the currently active field is not recorded until the active control's Valid event fires. So, my RecordChanged method contains the following code:
* Force the Valid() event for the current prompt...
IF TYPE('ThisForm.ActiveControl') = 'O'
ThisForm.ActiveControl.SetFocus()
ENDIF
cResults = GETFLDSTATE(-1)
How can I force the Valid event for an active control to fire without issuing SetFocus?