D
dellero
i have read the thread with Jeff Conrad and input all of the following:
1. Create a new small password form with the following properties:
-Scroll Bars No
-Record Selectors No
-Navigation Buttons No
-Dividing Lines No
-Auto Center Yes
-Pop Up Yes
-Modal Yes
-Border Style Thin
-Control Box No
-Min Max Buttons None
-Close Button No
-Shortcut Menu No
Name the form frmPassword.
Add a text box on this form called txtPassword with an Input Mask
of "Password" (without the quotations).
Add a label called lblPassword and have the caption say
something like "Please Enter Administrator Password."
Position just above the text box.
Add a command button called cmdCloseForm that simply
closes the form; nothing else in that code. Like so:
'Code Start
Private Sub cmdCloseForm_Click()
On Error GoTo ErrorPoint
DoCmd.Close acForm, "frmPassword"
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 Sub
' Code End
Add another command button called cmdShowAdminArea with
a caption of "OK" or something similar and enter the following code
into the Click event for this button:
'Code Start
Private Sub cmdShowAdminArea_Click()
On Error GoTo ErrorPoint
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
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 Sub
' Code End
i have personalised the following items;
"switchboard" to "admin"
and altered the Switchboard ID to "8" as it is in my database, but i keep on
getting an error that says it cannot find the form "Admin" can you suggest
where i might have gone wrong?
Thank You
Dellero
1. Create a new small password form with the following properties:
-Scroll Bars No
-Record Selectors No
-Navigation Buttons No
-Dividing Lines No
-Auto Center Yes
-Pop Up Yes
-Modal Yes
-Border Style Thin
-Control Box No
-Min Max Buttons None
-Close Button No
-Shortcut Menu No
Name the form frmPassword.
Add a text box on this form called txtPassword with an Input Mask
of "Password" (without the quotations).
Add a label called lblPassword and have the caption say
something like "Please Enter Administrator Password."
Position just above the text box.
Add a command button called cmdCloseForm that simply
closes the form; nothing else in that code. Like so:
'Code Start
Private Sub cmdCloseForm_Click()
On Error GoTo ErrorPoint
DoCmd.Close acForm, "frmPassword"
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 Sub
' Code End
Add another command button called cmdShowAdminArea with
a caption of "OK" or something similar and enter the following code
into the Click event for this button:
'Code Start
Private Sub cmdShowAdminArea_Click()
On Error GoTo ErrorPoint
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
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 Sub
' Code End
i have personalised the following items;
"switchboard" to "admin"
and altered the Switchboard ID to "8" as it is in my database, but i keep on
getting an error that says it cannot find the form "Admin" can you suggest
where i might have gone wrong?
Thank You
Dellero