Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to bypass Valid event of a Textbox 2

Status
Not open for further replies.

Rajesh Karunakaran

Programmer
Sep 29, 2016
549
MU
Hi Team,

I have a textbox and a command button in a form. The command button is to exit from the form. Textbox has some code in its Valid method. It invokes a help list (another form) if the textbox value is empty. Now, when the focus is in the textbox and when I click the command button, the Textbox Valid fires and the help list is shown. I have to then exit from the help list and once again click on the command button.

Is there anyway to avoid this second click?

I mean, something like to identify if I click on the command button when the focus is on the textbox and then to bypass the Valid event firing and directly run the command button code.

Thanks
Rajesh
 
Hi Team,

After going through all the suggestions and options, I have done the following and it seems most of the problems are solved.
1. Took off the help-list activation from the VALID of the text box.
2. Kept a '?' button next to the text box, clicking which will launch my help list.
3. Added 'F5' key trap in KeyPress event of the text box which would call the ? button's 'Click' event thereby launching the help-list.

Now, my Close button also does its job without any issue.

Thank you very much for your valuable time once again.
Rajesh
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top