password displayed as asterisks

G

Guest

Hi, I'd like to have the password stored as the character, but displayed as
asterisk(*) as the user enters the password. What code would I add to the
following code?Many thanks for your time and help

Private Sub Form_Open(Cancel As Integer)
Const strFormPassword As String = "password"

If InputBox("Please enter password") <> strFormPassword Then
MsgBox "Password incorrect. Please try again", vbOKOnly
Cancel = True
Else
DoCmd.Restore
DoCmd.Close acForm, "frmMainSwitchboard", acSaveNo
End If
End Sub
 
R

Rick Brandt

Sam Kuo said:
Hi, I'd like to have the password stored as the character, but displayed as
asterisk(*) as the user enters the password. What code would I add to the
following code?Many thanks for your time and help

Private Sub Form_Open(Cancel As Integer)
Const strFormPassword As String = "password"

If InputBox("Please enter password") <> strFormPassword Then
MsgBox "Password incorrect. Please try again", vbOKOnly
Cancel = True
Else
DoCmd.Restore
DoCmd.Close acForm, "frmMainSwitchboard", acSaveNo
End If
End Sub

You can't do what you want using an InputBox. You would have to substitute a
custom form instead. Then you can use an InputMask of "Password" and it will
display asterisks as the user types.
 
G

Guest

Thanks for your prompt reply. Much appreciated.

Rick Brandt said:
You can't do what you want using an InputBox. You would have to substitute a
custom form instead. Then you can use an InputMask of "Password" and it will
display asterisks as the user types.
 
J

Juan M Afan de Ribera

-----------------------------------------------------------------------
Por favor, responde a este mensaje y dinos si te funcionó o no. Gracias
-----------------------------------------------------------------------

If you are interested, there is an example for displaying asterisks in a
InputBox in this link

http://www.mvp-access.com/juanmafan

look for the example called "InputBoxEx". The explanation is in spanish, but
if needed I could translate that page to english (well... to my bad english)

HTH

Saludos,
Juan M Afan de Ribera
[MVP Access]
http://www.mvp-access.com/juanmafan
 

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

Similar Threads


Top