How do I make it that when my form opens up a certain text box has priority....example form opens up cursor to type would be shown, and if i was to click enter it would press a certain command button? Any ideas?
Printable View
How do I make it that when my form opens up a certain text box has priority....example form opens up cursor to type would be shown, and if i was to click enter it would press a certain command button? Any ideas?
Use the SetFocus method.
Code:Private Sub Form_Activate()
MyTextBox.SetFocus
End Sub
You can do a couple of things. Set the TabIndex property of the text box to 0 or use the a statement like text1.setfocus. For the command buttom part of your question set the Default property to that buttom to true and then when you hit enter the command_click will be executed.