Password on opening a form

Groundrush

Registered User.
Local time
Today, 21:34
Joined
Apr 14, 2002
Messages
1,376
Does anyone know how to password protect forms on a database without having to put a password on the whole database?

thanking you in advance
 
Prior to or OnOpen, prompt user for the password,if it's good open your form, otherwise give a message that user access is not allowed.
 
Thanks, but how do you create a password for a form only? the security in tools secures the whole database.
 
Use a command button and put this code behind it.

Private Sub Command1_Click()

Dim strPasswd

strPasswd = InputBox("Enter Password", "Restricted Form")

If strPasswd = "Type your password here" Then

DoCmd.OpenForm "FrmAmendDatabase", acNormal

Else

Beep

MsgBox "Only members of the Admin Group can amend this database application"

Exit Sub

End If

End Sub

Hope this helps
Hayley
 
Hayley, when you say to put the code behind the button, does this mean a new line of code and do away with the Command0_Click()line or add your new line of code below the Command0_Click() line?

I'm new and wanting to understand.

Thanks
 
cwash, I think the line you´re talking about corresponds to Hayley´s first.

Fuga.
 
Fuga, thanks for the help. I got it to work. But...when I type in the password, I see the password spelled out! This would not be any good if someone is standing over my shoulder! So, how do you get it to NOT show the word but rather the ***'s.

TIA
 
Don´t know that, but maybe you can make the text invisible?

Fuga.
 
I've got a password sample. If you want it, email me and I'll forward it on.
 
DBL

I would really appreciate your example also.

Would you mind mailing it to me.

Thanks

DW
 
DBL, I'd like the sample also if I could.
How do I get your email?

Thanks
 
You can get my email address from the envelope icon on my posting.

dawn.lawson@1stclass.uk.com
 

Users who are viewing this thread

Back
Top Bottom