General information
Category:
Coding, syntax & commands
I am working on a form that has a textbox called txtCustno and the Valid event shoot off a method called m_query. In this method if a matching record is not found, then it gives you a wait window, clears the text box and should set focus back to the text box.
This is part of the code in m_query
ELSE
WAIT WINDOW "No Matching Customer Found."
Thisform.txtCustno.Value = ""
Thisform.txtCustno.SetFocus()
ENDIF
When I run the program and my method fires, when it finds no matching customer it does the wait window, the clearing of the textbox, but it ives me an error for the SETFOCUS() line and when I ignore it moves me to the next textbox.
The Error is:
ERROR 2012: Cannot call SetFocus from within a WHEN, VALID, ...
Program Code Causing Error: Thisform.txtCustno.SetFocus()
Any ideas?
Your help is greatly appreciated.
Thanks,
Alex
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only