Information générale
Catégorie:
Codage, syntaxe et commandes
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
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement