Open a form with password

  • Thread starter Diego via AccessMonster.com
  • Start date
D

Diego via AccessMonster.com

I need to open a specific form with a password
I writed this code that works fine but with a limitation. The users can see
the password during typing, instead to see ****** as usual
Anyone can help me ?
sorry for the italian words inside
Regards
Diego

Dim strInputBox As String, bytChoice As Byte
Dim ctl As Control
InputPoint:
strInputBox = InputBox("Inserisci la password.", "Area Protetta da password!
")
If Len(strInputBox) > 0 Then
If strInputBox <> "pippo" Then
bytChoice = MsgBox("Password non corretta" & vbNewLine & vbNewLine &
"Vuoi riprovare ?", vbExclamation + vbYesNo, "Warning")
If bytChoice = vbYes Then
GoTo InputPoint
Else
Cancel = True
End If
Else
DoCmd.OpenForm ("Campi_Report")

End If
Else
'Cancel = True
'End If
 
D

Dale Fye

Diego,

Open your form in design view. Select the password textbox. Then, in the
properties dialog, select the Data tab, and set the inputmask to Password.

--
HTH
Dale

Don''t forget to rate the post if it was helpful!

email address is invalid
Please reply to newsgroup only.
 
D

Diego via AccessMonster.com

I am not sure to understand.
My code is related to On Open event. when i try to open the form a box is
opened and ask the password.
How can avoid to see the password name when i type the password?
Bye


Dale said:
Diego,

Open your form in design view. Select the password textbox. Then, in the
properties dialog, select the Data tab, and set the inputmask to Password.
I need to open a specific form with a password
I writed this code that works fine but with a limitation. The users can see
[quoted text clipped - 25 lines]
'Cancel = True
'End If
 
D

Dale Fye

I think I understand now.

You are using the InputBox function to get the password, aren't you? In
that case, you cannot mask the input characters.

Instead, create your own login form, which should be the first form your
users see. Put a textbox on it (txt_Password) and two command buttons
(cmdClose and cmdLogin). Put the code that checks for the password in the
Click event of the cmdLogin command button. I usually give my users 3 tries
to get it right, then close the application on them; something like:

Private Sub cmdLogin_Click

Static intAttempts as integer

if me.txtPassword = GoodPwd Then
docmd.close acform, "frm_Login"
docmd.openform "frm_Mainform"
else
msgbox "Invalid password!"
intAttempts = intAttempts + 1
if intAttempts > 3 then docmd.quit
endif

End Sub

In the code in the cmdClose_Click event, have code like:

Private sub cmdClose_Click

docmd.Quit

End Sub

--
HTH
Dale

Don''t forget to rate the post if it was helpful!

email address is invalid
Please reply to newsgroup only.



Diego via AccessMonster.com said:
I am not sure to understand.
My code is related to On Open event. when i try to open the form a box is
opened and ask the password.
How can avoid to see the password name when i type the password?
Bye


Dale said:
Diego,

Open your form in design view. Select the password textbox. Then, in the
properties dialog, select the Data tab, and set the inputmask to Password.
I need to open a specific form with a password
I writed this code that works fine but with a limitation. The users can see
[quoted text clipped - 25 lines]
'Cancel = True
'End If
 
D

Diego via AccessMonster.com

Ok
now is clear
thank you very much

Bye

Dale said:
I think I understand now.

You are using the InputBox function to get the password, aren't you? In
that case, you cannot mask the input characters.

Instead, create your own login form, which should be the first form your
users see. Put a textbox on it (txt_Password) and two command buttons
(cmdClose and cmdLogin). Put the code that checks for the password in the
Click event of the cmdLogin command button. I usually give my users 3 tries
to get it right, then close the application on them; something like:

Private Sub cmdLogin_Click

Static intAttempts as integer

if me.txtPassword = GoodPwd Then
docmd.close acform, "frm_Login"
docmd.openform "frm_Mainform"
else
msgbox "Invalid password!"
intAttempts = intAttempts + 1
if intAttempts > 3 then docmd.quit
endif

End Sub

In the code in the cmdClose_Click event, have code like:

Private sub cmdClose_Click

docmd.Quit

End Sub
I am not sure to understand.
My code is related to On Open event. when i try to open the form a box is
[quoted text clipped - 12 lines]
 

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