How to use password in MS Access
I want to use a button for password protecting method. Tried out the following code. But it isn't working properly.
Could you please specify the bugs and could you please handle these?
Thank you million times.
If InputBox("password") = "thepassword" then
Docmd.OpenForm formname
Else
MsgBox "You are not authorized!",vbOKOnly
End if
Private Sub Open_Activities_Menu_Click()
If InputBox("Enter password") = "111111" Then
DoCmd.OpenForm Activities_Menu
Else
MsgBox "You are not authorized!", vbOKOnly
End If
End Sub
The issue is the DoCmd line where I get a message
Run-time error '2494':
The action or method requires a Form Name argument
Your help is very much appreciated,
Thank you.








