Textbox Return

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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"
 
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.
 
Back
Top