Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Setfocus problem
Message
From
12/04/2007 03:19:18
Yim Ming Sun Derek
Spacious Design Consultant
Hong Kong, Hong Kong
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Setfocus problem
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01214849
Message ID:
01214849
Views:
50
Hi,
I want to control user to enter client code in a editbox and not allow enter a blank client code, if user enter a blank field, an warning message will display and setfocus to the editbox, I put the checking code in the Lostfocus event of the editbox, the code as follow:-
SET EXACT ON 
IF SEEK(ALLTRIM(thisform.txtCusno.Value),"CUSMAS")
   thisform.txtCusname.Value = cusmas->cusname
ELSE
	IF EMPTY(thisform.txtCusno.Value)
		MESSAGEBOX("You must enter client code!",48,"Warning")
	ELSE
		MESSAGEBOX("Client code not exist!",48,"Warning")
	ENDIF
   	thisform.txtCusname.Value = " "
	thisform.txtCusno.SetFocus()
ENDIF
When user press TAB to bypass the input, I find that thisform.txtCusno.SetFocus() does not work. I try to put this checking into the VALID event, but the VALID event does not allow the setfocus statement.
How could I do? please suggest.

Thanks

Derek Yim
Next
Reply
Map
View

Click here to load this message in the networking platform