Access Protection

cookies

New Member
Joined
Apr 1, 2005
Messages
4
Does anyone know if it is possible to password protect only certain forms and not the entire database? Any help is much appreciated. Thanks!!
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
This was suggested to me by someone on this board. It works really well. Hope it helps you.

The following code is attached to the on click event of a button that I have that opens a "Password" form that I created. The password form has a text box for the user to key in the passwork, an OK button to open the desired form if the password is correct, and a cancel button to close the form and return to the previous menu.

Private Sub Maint_Menu_Button_Click()
On Error GoTo Err_Maint_Menu_Button_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Passwordfrm"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Maint_Menu_Button_Click:
Exit Sub

Err_Maint_Menu_Button_Click:
MsgBox Err.Description
Resume Exit_Maint_Menu_Button_Click

End Sub

___________________
This code is attached to the "OK" button on my password form.

Private Sub Command2_Click()

On Error GoTo Err_Command2_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "YourFormNameHERE"

If Me.Text0 = "yourpassword" Then
DoCmd.Close
DoCmd.OpenForm stDocName, , , stLinkCriteria
Else
MsgBox "Incorrect Password!"
Me.Text0 = ""
End If

Exit_Command2_Click:
Exit Sub

Err_Command2_Click:
MsgBox Err.Description
Resume Exit_Command2_Click

End Sub

________________
This is the code attached to the cancel button on the password form.

Private Sub Command3_Click()
On Error GoTo Err_Command3_Click
DoCmd.Close
Exit_Command3_Click:
Exit Sub
Err_Command3_Click:
MsgBox Err.Description
Resume Exit_Command3_Click
End Sub
 
Upvote 0

Forum statistics

Threads
1,221,889
Messages
6,162,624
Members
451,778
Latest member
ragananthony7911

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top