Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SETFOCUS( ) Error
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
SETFOCUS( ) Error
Divers
Thread ID:
00397679
Message ID:
00397679
Vues:
40
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
Fil
Voir

Click here to load this message in the networking platform