A
Andrew
I wish to input a password using a Form called InputPwd (I'm not using an
InputBox since this can't hide the password typed). The form contains:
- a TextBox called Password and
- a Button called OKbutton
The code associated with OKbutton is:
Private Sub OKButton_Click()
InputPwd.Hide
End Sub
This behaves nearly as I want. To test it I run the following Macro:
Sub Mysub()
InputPwd.Show
MsgBox (InputPwd.Password)
End Sub
This displays the form. I can then type the password which is hidden by *
(the PasswordChar set in the TextBox properties). What I would like is that
pressing Enter at the end of typing the password should behave just as if
I've clicked on the OKbutton. Instead it moves the focus from the TextBox
to the OKbutton, meaning that I have to press Enter twice to submit my
password.
I'm sure there must be a way to get pressing Enter to do what I want.
InputBox since this can't hide the password typed). The form contains:
- a TextBox called Password and
- a Button called OKbutton
The code associated with OKbutton is:
Private Sub OKButton_Click()
InputPwd.Hide
End Sub
This behaves nearly as I want. To test it I run the following Macro:
Sub Mysub()
InputPwd.Show
MsgBox (InputPwd.Password)
End Sub
This displays the form. I can then type the password which is hidden by *
(the PasswordChar set in the TextBox properties). What I would like is that
pressing Enter at the end of typing the password should behave just as if
I've clicked on the OKbutton. Instead it moves the focus from the TextBox
to the OKbutton, meaning that I have to press Enter twice to submit my
password.
I'm sure there must be a way to get pressing Enter to do what I want.