See this page on my site for any and all Switchboard Manager questions:
http://home.bendbroadband.com/conradsystems/accessjunkie/switchboardfaq.html
In your particular case, this specific area:
http://home.bendbroadband.com/conradsystems/accessjunkie/switchboardfaq.html#security
(Watch out for any possible line wrapping on those links)
Please note I need to make a slight modification to the code. I forgot
to do this before so I will try and remember to change the page this weekend.
Change the code listed on the page to this:
'********Start of new code**********
Private Sub cmdShowAdminArea_Click()
On Error GoTo ErrorPoint
If Len(Nz(Me!txtPassword, "")) = 0 Then
MsgBox "Please enter a password before continuing." _
, vbCritical, "Missing Password"
Me.txtPassword.SetFocus
Else
If Me.txtPassword <> "password" Then
' Substitute with your own password between the quotes
MsgBox "Incorrect Password", vbExclamation, "Access Denied"
DoCmd.Close acForm, "frmPassword"
Else
Forms!Switchboard.Filter = "[ItemNumber] = 0 And [SwitchboardID] = 2"
Forms!Switchboard.Refresh
DoCmd.Close acForm, "frmPassword"
End If
End If
ExitPoint:
Exit Sub
ErrorPoint:
' Unexpected Error
MsgBox "The following error has occurred:" _
& vbNewLine & "Error Number: " & Err.Number _
& vbNewLine & "Error Description: " & Err.Description _
, vbExclamation, "Unexpected Error"
Resume ExitPoint
'********End of new code**********
End Sub
--
Jeff Conrad
Access Junkie - MVP
http://home.bendbroadband.com/conradsystems/accessjunkie.html
http://www.access.qbuilt.com/html/articles.html
in message: