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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

COMMAND BUTTON FOCUS 1

Status
Not open for further replies.

Kevsim

Instructor
Apr 18, 2000
385
AU
I have a form with a command button (command button 1), when this button is pressed, A text box , a label and another command button (command button 2) appear. After text is inserted into the text box, command button 2 is pressed to submit the data. If the data is not accepted I want the text box, label and command button, not to be visible. This works OK in after update of command button 2, except an error message appears stating “You can’t hide a control that has the focus”. I would appreciate advice as to how I can accomplish the above.
kevsim
 
Just move the focus to an object that will always be visible before enacting your code. Life's a journey enjoy the ride...

jazzz
 
jazzz, thanks for the reply, much appreciated. could you please explain a little further as to how to do it, the code would help.
kevsin
 
I don't know what your code is so I can't code what you need? So what I am referring to is this. I assume your command button 1 is always available? So what you need to do in your afterupdate of Command button 2 *again I assume* this is where you are running the code from the very first line of code would be Me("whatever command button 1 is").setfocus then the rest of your code. Life's a journey enjoy the ride...

jazzz
 
jazzz, thanks for the info, it works great.
kevsim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top