Hello there!
I have a weird problem again; basically is the form's behavior, but let me try to explain:
I have an Append Change & Delete form that I call in two different situations. My problem is that I created a method in order to validate the data entered by the user in the form, but when I call the method I get an error that reads: *!* Cannot call SetFocus from within a When, Valid, RangeHigh or RangeLow event. *!* and this Method is being called from the click event of a Command Button on the Form by using the following code:
*!* This code is in the click event of a CommandButton
IF Thisform.ValidateData() && If the method returns .T.
Thisform.SaveData() && Call the Method that saves the information into the table
ENDIF
*!* If the ValidateData is .F. a SetFocus Method will fire to set the cursor in the proper cotrol.
I use the SetFocus() Method in my ValidateData() Method, but I should not be getting this error since is not a Valid, RangeHigh or RangeLow event, the funny part is that if I run this form from one form where the Environment is already Open I don't get this error and the SetFocus event fires perfectly, but in the other hand If I call the form and execute the OpenTables Method with some of the tables involved in the form already open I get this error. What in the world is wrong with this?.
Thank you very much for your replies.
Mao
Mao
intelisoft Corporation