Focus on correct textbox in UserForm

  Desert Andy 13:01 22 Apr 2010

I am using a userform to aquire data from the end user. However, when the userform appears, the focus is on the incorrect textbox, so the user has to select the correct textbox before they can entere the data. How do I set the focus on the correct textbox when I get the Userform to appear. I am writing code inVBA for Excel 2007. Thanks very much.

  VoG II 13:12 22 Apr 2010

Right click the userform and select Tab Order. You can then change the order as needed.

  KremmenUK 13:22 22 Apr 2010

Not used VBA for ages but in VB you can use the .setfocus method as long as the form is loaded.

The above Tab Order is your first port of call though as you should have them in the order required in case the user tends to use keyboard before the mouse.

  Desert Andy 13:24 22 Apr 2010

Thanks very much

This thread is now locked and can not be replied to.

Elsewhere on IDG sites

Samsung Galaxy S9 review

Wacom Cintiq Pro 24 and 32 review – hands-on

When is the next Apple event?

Qu’est-ce qu’Amazon Prime ?