UserForm questions about text box propertys, thanks

  • Thread starter Thread starter pgarcia
  • Start date Start date
P

pgarcia

I created a user form with a command button and text box.
1. When loaded, the command button is selected, how do you select the text
box?
2. Will the cuser be blinking in the text box?
3. When the data is enter in the text box, how to get the "enter" button on
the key board to be used? Right now, you enter the data and then have to
click on the command button.

Thanks.
 
1. You can use the userform_initialize event to select the control you want:

Option Explicit
Private Sub CommandButton1_Click()
MsgBox "Ok clicked"
End Sub
Private Sub UserForm_Initialize()
Me.TextBox3.SetFocus
End Sub

2. Test it and you'll see.

3. What do you want enter to do? Click the ok button?

If yes, you can change the .Default property of the button you want to True.

Either in Code:
Me.CommandButton1.Default = True
or while you're in design mode.
 
1. Set the Tab order (view menu) so the textbox is at the top.
2. Yes
3. Set the Default property of the command button to true.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)



"pgarcia"
wrote in message
I created a user form with a command button and text box.

1. When loaded, the command button is selected, how do you select the textbox?
2. Will the cuser be blinking in the text box?
3. When the data is enter in the text box, how to get the "enter" button on
the key board to be used? Right now, you enter the data and then have to
click on the command button.
Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top