Thanks for the reply. The discussion on the link (that boblarson supplied) talks about setting a password on a Switchboard menu button. However, in Access 2007 you can always go the "Navigation Pane" to get to the form, which would by-pass the password.
I have found a method to assign a password to an Inputbox, by using this code in an open form event: Cancel = (InputBox("Give password:") <> "MySecretPassword").
However, I have found no way for the user to change the password.
Surely, there must be some way to assign a password to a form and then have a way for the user to change it periodically.
You need to dump the macro approach and jump into the sea of VBA. User's are also encouraged to search the forum before posting. Your question has been asked and answered in many threads.
You can cheaply and quickly add a function to the OnClick event of your buttons to force the user to input the correct password into an Input Box if they want to access [open a form, report, etc]. You can search this forum for examples of all of the above. The code below will show you how to do it...
Code:
Dim strInput As String
Dim strMsg As String
Beep
strMsg = "This form is used only by the ''Special Form'' people." & vbCrLf & vbLf & "Please key the ''Special Form'' password to allow access."
strInput = InputBox(Prompt:=strMsg, title:="Special Password")
If strInput = "SpecialFormPassword" Then 'password is correct
DoCmd.OpenForm "YourSpecialFormNameHere"
DoCmd.Close acForm, Me.Name
Else 'password is incorrect
MsgBox "Incorrect Password!" & vbCrLf & vbLf & "You are not allowed access to the ''Special Form''.", vbCritical, "Invalid Password"
Exit Sub
End If
You can format an Input Box with astericks **** but it takes a ton of code. Search the forum with the keyword "InputBoxDK" if you really need to do it.
The above is a simple way to call an input box that allows the user to key a password and if correct it will open a form. Assign the code to the OnClick event of the button to open the form that you want password protected.