Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Tricky textbox scenario
Message
From
28/02/2007 09:43:11
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
01199526
Message ID:
01199530
Views:
22
>I have a textbox on a small form which users can enter job numbers from 1 to 9999. However, if they enter a zero, I want the form to release,(bringing them back to a previous form). I have tinkered with the keypress event but if a user enters 650, the '0' would trigger the keypress event and release the form. But I need to compare the whole textbox.value to what the last key typed was and it seems the keypress event is not where to do this. Any ideas?

LostFocus would be a better place. You add:
This.Tag=alltrim(this.value)
to Textbox.Gotfocus event, and
If This.Tag==Alltrim(this.value)
  Return
Endif
If Val(This.Value)=0
  Release Thisform
  Return
Endif
to Textbox.Lostfocus event
Edward Pikman
Independent Consultant
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform