password Protecting Switchboard Items

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
 
J

Jeff Conrad

Review the steps I have here on my web site:

http://home.bendbroadband.com/conradsystems/accessjunkie/switchboardfaq.html#security

It has a little bit different code.
"switchboard" to "admin"

Why are you doing this?
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?

It is looking for a form named Admin.
Did you change the name of your Switchboard from "Switchboard"
to "Admin" by chance???

--
Jeff Conrad
Access Junkie - MVP
http://home.bendbroadband.com/conradsystems/accessjunkie.html
http://www.access.qbuilt.com/html/articles.html

in message:
i have read the thread with Jeff Conrad and input all of the following:

<steps snipped>
 
D

dellero via AccessMonster.com

When the Switchboard was created it was called "Admin" because it is an admin
area we are trying to protect but i did try to rename it to switchboard just
incase, with no change.

btw, the way i was changing the name was in "switchboard manager" im assuming
this is the correct way of doing it?
 
D

Daniel Ellero via AccessMonster.com

i've updated the code to match your changes with no effect to my Initial
problem
When the Switchboard was created it was called "Admin" because it is an admin
area we are trying to protect but i did try to rename it to switchboard just
incase, with no change.

btw, the way i was changing the name was in "switchboard manager" im assuming
this is the correct way of doing it?
Review the steps I have here on my web site:
[quoted text clipped - 17 lines]
<steps snipped>
 
J

Jeff Conrad

in message:
When the Switchboard was created it was called "Admin" because it is an admin
area we are trying to protect but I did try to rename it to switchboard just
incase, with no change.

The Switchboard Manager creates one and *only* form called Switchboard
in the Database Window. You can change this name by right clicking on it
and naming it something else, but there is no need to do this. Leave that form
name as Switchboard.
btw, the way I was changing the name was in "switchboard manager" I'm assuming
this is the correct way of doing it?

???
No, not at all.
If you follow my instructions to the letter you should have one form called
Switchboard (this is the form the wizard created) and a second form called
frmPassword. That password form is opened when you want to go to
a "secured" sub-switchboard menu. You must remember that even though
the form seems to change by different command buttons becoming visible,
you are still interacting with one form called Switchboard.

Nothing *needs* to be called Admin if you follow the instructions.
Where does the error occur and more specifically *what* form generates
the error?
 
D

Daniel Ellero via AccessMonster.com

It Works!! ha ha!!!! thank you very much there where two main problems, 1.
the code was looking for a switchboard called "admin" when it was still
called "switchboard" and 2. after everything was working it didnt work unless
i tried it in the switchboard menu, i was just going on the forms area and
opening "frmpassword" but it couldn't find the switchboard until i tried it
in the switchboard.]

thank you!

Dellero
 
C

Chris Mills

Is this the same Jeff Conrad (purported MVP) who posts free downloadable
cracks for Microsoft Access Security?

Chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top