View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default UserForm questions about text box propertys, 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.



pgarcia wrote:

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.


--

Dave Peterson