Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Disable Valid method on button click
Message
From
08/01/2017 08:50:24
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01646389
Message ID:
01646395
Views:
51
>>>Hi,
>>>
>>>I have a form that (simplified) has 2 textbox controls and a button next to the first textbox. The button click brings up a lookup form, for user, instead of typing entry, to select from the lookup form. The textbox has a code in Valid method that sets the value in the second box, based on the entered value in the first textbox. For example, the first text box is for entering a Part No and the second one shows the Price of the selected Part Number. So the value in the second textbox is set in the Valid method, which should fire on a user entering the value manually, scanning a barcode, or when entry is selected by lookup button/form.
>>>
>>>What happens is when a user enters a partial entry in the textbox and then clicks on the lookup button, the Valid even fires.
>>>
>>>How would I disable the Valid event when user clicks on the button and only fire when user enters and presses Enter or when he/she scans barcode?
>>>
>>>TIA
>>
>>Don't use the valid event for this code. Instead you create a new method and call it whenever you want.
>
>Interesting suggestion. I will have to think of how to call the new method on the press of Enter key. Thank you.

You can use the KeyPress event.
If nKeyCOde = 13
   yourmethod()
Endif
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform