How to make users to enter PASSWORD in a FORM

M

Martin

I have a button in a form, when you click this button, the access will show
you a message box( if msg box can't do, pls tell me what else can do) which
requires you to enter a password. If the password you entered is right (for
example using VBA to determined) then the access show you something; if the
password is not right then the access show you other things.

Question: Can a message box do this--require to enter password?
If message box can't do this, any other good method?

Thanks!
 
G

Guest

Hi Martin,

You'll want to use a form or an Inputbox, not a message box. Between the
two, I prefer to use a form with a textbox. You can set password as the
input mask for the textbox, so that asterisks will be displayed as the user
enters their password. Then run code associated with a command button to
validate the password.


Tom

http://www.access.qbuilt.com/html/expert_contributors.html
__________________________________________

:

I have a button in a form, when you click this button, the access will show
you a message box( if msg box can't do, pls tell me what else can do) which
requires you to enter a password. If the password you entered is right (for
example using VBA to determined) then the access show you something; if the
password is not right then the access show you other things.

Question: Can a message box do this--require to enter password?
If message box can't do this, any other good method?

Thanks!
 
M

Martin

Hello!

I have found my "way" to resolve this problem, simple and easy : )

Private Sub Form_Open(Cancel As Integer)
Dim hold As Variant

hold = InputBox("Please input the password. ", "Hello!")

If hold <> "12W5" Then
MsgBox "Your password is wrong!", , "Hello"
DoCmd.Close
Else
Exit Sub
End If
Exit Sub
End Sub


I believe, my method is also a good one :)
 

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