Problem with password on Report

  • Thread starter Thread starter riaang
  • Start date Start date
R

riaang

Guest
Hi,
I use the following event to password protect my report but have a problem with the line in red.

Private Sub Report_Open(Cancel As Integer)
If InputBox("Enter Password", "Password Required") <> "4062" Then
MsgBox "Access denied"
DoCmd.Close acReport, Me.Name
End If
End Sub

Can anybody help me to fix the problem.

Regards

Riaan

PS. Is it possible to password protect a specific switchboard item and not the whole switchboard.
 
Code:
Private Sub Report_Open(Cancel As Integer)
If InputBox("Enter Password", "Password Required") <> "4062" Then
MsgBox "Access denied"
DoCmd.CancelEvent
End If
End Sub

IMO
 
Thanks IMO,

Do you perhaps know of a way to password protect a specific item on the switchboard. I want a button on the main switchboard like management reports that needs to be password protected.

Thanks for your assistance.
 

Users who are viewing this thread

Back
Top Bottom