Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SETFOCUS( ) Error
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
SETFOCUS( ) Error
Miscellaneous
Thread ID:
00397679
Message ID:
00397679
Views:
41
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
Map
View

Click here to load this message in the networking platform