Textbox Return

J

Johnny

I have a userform with a textbox that calls for a password to be entered.
When the userform loads, I would like to cursor to appear in the textbox. I
would also let the enter key to accept what's entered in the text box instead
of move to the next object on the form. Here's the code I have so far:

If Me.TextBox1.Text = ThisWorkbook.Worksheets("Sheet3").Range("B90").Value
Then
Unload Me
Else
MsgBox "Incorrect Password. Try Again"
 
J

John Bundy

On the properties section for the textbox make sure that tab stop is true and
set the TabIndex to 0. On the buttons properties set Default to True.
 

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

Top