ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Textbox Return (https://www.excelbanter.com/excel-discussion-misc-queries/128618-textbox-return.html)

Johnny

Textbox Return
 
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").Val ue
Then
Unload Me
Else
MsgBox "Incorrect Password. Try Again"

John Bundy

Textbox Return
 
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.
--
-John Northwest11
Please rate when your question is answered to help us and others know what
is helpful.


"Johnny" wrote:

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").Val ue
Then
Unload Me
Else
MsgBox "Incorrect Password. Try Again"



All times are GMT +1. The time now is 08:16 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com