Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Keeping focus in a field
Message
From
31/10/2008 16:17:06
 
 
To
31/10/2008 15:48:27
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 6
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01358775
Message ID:
01358788
Views:
21
Try putting the code in the VALID method and

RETURN 0



>Hi all
>
>on a form, I've got a textbox that feeds a listbox, and I'd like to have focus remain in this textbox until the user leaves it blank.
>
>Here's the code from the lostfocus event
>
>
>if empty(this.value)
>  return
>endif  
>
>sele Ther
>seek alltrim(this.value)
>if !found()
>  wait window "Staff Code Not Found"
>else
>  ThisForm.LstStaff.AddListItem(alltrim(Ther.fname) + ' ' + alltrim(Ther.lname) + iif(empty(Ther.title),'',' ' + Ther.title))
>  thisform.lststaff.addlistitem(Ther.thid, thisform.lstStaff.NewItemID,2)
>  Thisform.lststaff.numberofelements = Thisform.lststaff.numberofelements + 1
>endif    
>this.value = ''
>return -1
>
>
>
>The "return -1" replaced the "this.setfocus()" call that didn't work either
>
>what simple, gads-I'm-gonna-feel-14-kinds-of-stupid thing am I missing?
Previous
Reply
Map
View

Click here to load this message in the networking platform