PDA

View Full Version : [SOLVED:] Selecting / Activating TextBox on UserForm



Len Piwowar
10-08-2006, 06:20 PM
I created a userform which has textboxes and comboboxes on it. I would like Me.textbox1 to be the active or selected box with the cusor flashing in it when the form is shown. I have tried; me.textbox1.setfocus, me.textbox1.select and me.textbox1.activate but non of these approaches seem to work. Thanks In Advance!!

webtubbs
10-08-2006, 06:29 PM
Hi Len,

To have the focus on a control on form load, set the TabIndex property of that control to 0.

asingh
10-08-2006, 10:55 PM
Hi....

Did you put "me.textbox1.setfocus" in the main forms......activate event...? Try it there..and it should work...!

regards

asingh

lucas
10-09-2006, 08:15 AM
Try setting it in the userform initialize statement:

Private Sub UserForm_Initialize()
Me.TextBox1.SetFocus
End Sub