Password on Forms

  • Thread starter Thread starter Rob
  • Start date Start date
R

Rob

I want users not to be able to open some of the forms
without a password. They would attempt to open the forms
by command button. Is there anyway to restrict opening a
form without a password? Any suggestions would be greatly
appreciated.
 
-----Original Message-----
I want users not to be able to open some of the forms
without a password. They would attempt to open the forms
by command button. Is there anyway to restrict opening a
form without a password? Any suggestions would be greatly
appreciated.


.

You might be better off using Access permissions for
something like that; sound like a lot of hard work to me !

Failing that, the Form_Open Event has a Cancel argument,
so you could place your code there, and set Cancel to True
if they don't enter the correct one. Something like this

Private Sub Form_Open(Cancel As Integer)

Const cstrPassword = "password"

If InputBox("Enter password:") <> cstrPassword Then
MsgBox "Wrong password!", vbExclamation
Cancel = True
End If

End Sub


Hope that helps. Let me know how you get on.


Damien
 

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

Password associated with a particular form - Acess 2007 1
error 2489 1
Form security 1
Password Form 4
Excel Excel macro and passwords 3
How do I set a password on a DB object (FORM)? 3
Windows 10 W10 password prob. 2
Creating a form for a Password 1

Back
Top