Switchboard behind password

G

Guest

Being a brand new user of Access (A-2000)and a real noob on VB, I'm having
the worst of my time trying to make a "special menu" using switchboard
manager. I've figured out everything I want my db to do, but still haven't
been able to put 2 buttons on the first (of 3) switchboard in which the user
would pick either of them and ask him to input a password to redirect him to
the next "protected" switchboard.

Objective.- To have a switchboard that will enable a user to access an
"admin switchboard" through a password.

I've seen the code of the switchboard form,and even seen some codes online
on how to make a button (any button) ask for a password, but the way the
manager arranges the switchboard form (creating a table) makes it impossible
(to me) to get that "online aquired code" IN my switchboard manager made
form...
 
R

Rick B

I doubt you can do it on your switchboard. If you create your own form that
looks like a switchboard, then you can put code in the "open" event to
require a password. Personally, I think that is a very very bad idea. I
prefer to set up user-level security and then control access to objet based
on the login.

If I were and administrator, I would not want to have to type in passwords
all over the place while working in my database. I'd prefer to type in a
user id and password once when I open the file, and know that I could get to
anything to which I had access. It would also be nice to know that others
could not get into anything they shouldn't.

If you want to password protect a form, there are plenty of posts out there
on how to do it. Just do a search on previous messages and you should find
some.

Rick B
 
G

Guest

In this particular case password is not intended for a large group of people
or "high security" reasons (maybe not even security reasons at all). Is just
to avoid looking info certain user does not want to see.

If I understand the idea, it would be enough to make a new form
(copy-pasting from the switchboard) in which I can put 2 buttons with a code
included in the "open" event in every one of them, and that takes me either
to my "user1_options" or "user2_options" switchboard, ?

In the case that this is correct, I have to input a password EVERY single
time I open another form?, or it just sticks with the first "jump" between my
new form and the "userX_options" switchboard?

Besides, is it possible to make this new hand made form the default after
the splash screen ?

Thanx in advance Rick !
 
J

Jeff Conrad

Hi Al,

-Trying again, because my posts are not going through-

I would have to agree with Rick on this issue.

Any kind of "Developer-implemented" security/password
schemes are really not all that secure. Implementing full-
blown Access User Level Security is really the *best* way
to go if you want to have some security built into your
application. It is a difficult and challenging task to implement
the first couple of times, so it is best to thoroughly read up
on the subject before beginning and practice on "dummy"
databases. If you would like some links on the subject, post
back and I'll provide a few for you.

OK, having said the above, I also believe that there are times
and places when ULS is way too much overkill. If the data
is not ultra-sensitive and/or you have really low-tech users, a
*simple* security system can be more than sufficient. I have
done this before many times in the past.

So what you are looking for is to integrate something with the
built-in Switchboard Manager, correct? Here is a past post of
mine on this subject (modified just a bit) which should do exactly
what you are looking for. As long as you the developer fully
understand the limitations of this setup, then you may proceed.
Make a backup of your database BEFORE beginning!

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

This assumes that the Admin Switchboard area you want to
protect is number "2" in the Switchboard Items TABLE. Make
sure to change that number to whatever matches your table
value. This also assumes that the NAME of your switchboard
form is actually just "Switchboard." Change the code if
you have changed the name. Dress up the message box with
whatever formatting and/or messages you desire.

Use the Switchboard Manager Wizard to create the entry to
go to this Admin area. Instead of using the option that
opens up a Switchboard, make it open the frmPassword
instead. Like this:

Edit Switchboard Item:
Text: Go To Admin Area
Command: Open Form In Add Mode
Form: frmPassword

Now when the person clicks on the Switchboard option that
says "Go To Admin Area" the Password form opens up on top.
Unless they enter the correct password, the Switchboard
will not change to show the Admin menu. It would also be a
good idea to hide the Database Window from the users.
Hope that gets you going,
 
G

Guest

Hi Jeff,

Thanx a lot for the help, I made the changes today and worked just fine...

Thanx to both of you, I still have to read all about access security just in
case I really want to make something more serious.

Jeff Conrad said:
Hi Al,

-Trying again, because my posts are not going through-

I would have to agree with Rick on this issue.

Any kind of "Developer-implemented" security/password
schemes are really not all that secure. Implementing full-
blown Access User Level Security is really the *best* way
to go if you want to have some security built into your
application. It is a difficult and challenging task to implement
the first couple of times, so it is best to thoroughly read up
on the subject before beginning and practice on "dummy"
databases. If you would like some links on the subject, post
back and I'll provide a few for you.

OK, having said the above, I also believe that there are times
and places when ULS is way too much overkill. If the data
is not ultra-sensitive and/or you have really low-tech users, a
*simple* security system can be more than sufficient. I have
done this before many times in the past.

So what you are looking for is to integrate something with the
built-in Switchboard Manager, correct? Here is a past post of
mine on this subject (modified just a bit) which should do exactly
what you are looking for. As long as you the developer fully
understand the limitations of this setup, then you may proceed.
Make a backup of your database BEFORE beginning!

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

This assumes that the Admin Switchboard area you want to
protect is number "2" in the Switchboard Items TABLE. Make
sure to change that number to whatever matches your table
value. This also assumes that the NAME of your switchboard
form is actually just "Switchboard." Change the code if
you have changed the name. Dress up the message box with
whatever formatting and/or messages you desire.

Use the Switchboard Manager Wizard to create the entry to
go to this Admin area. Instead of using the option that
opens up a Switchboard, make it open the frmPassword
instead. Like this:

Edit Switchboard Item:
Text: Go To Admin Area
Command: Open Form In Add Mode
Form: frmPassword

Now when the person clicks on the Switchboard option that
says "Go To Admin Area" the Password form opens up on top.
Unless they enter the correct password, the Switchboard
will not change to show the Admin menu. It would also be a
good idea to hide the Database Window from the users.
Hope that gets you going,
--
Jeff Conrad
Access Junkie
Bend, Oregon

Al said:
Being a brand new user of Access (A-2000)and a real noob on VB, I'm having
the worst of my time trying to make a "special menu" using switchboard
manager. I've figured out everything I want my db to do, but still haven't
been able to put 2 buttons on the first (of 3) switchboard in which the user
would pick either of them and ask him to input a password to redirect him to
the next "protected" switchboard.

Objective.- To have a switchboard that will enable a user to access an
"admin switchboard" through a password.

I've seen the code of the switchboard form,and even seen some codes online
on how to make a button (any button) ask for a password, but the way the
manager arranges the switchboard form (creating a table) makes it impossible
(to me) to get that "online aquired code" IN my switchboard manager made
form...
 
J

Jeff Conrad

You're very welcome Al, glad to help.

When you are ready to move up to User Level Security
here is some *must-read* learning material on the subject:

Access User-Level Security:

Security FAQ (the Security Bible):
http://support.microsoft.com/?kbid=207793

Jack Macdonald's Security Document:
http://www.geocities.com/jacksonmacd/AJMAccessSecurity.pdf

Lynn Trapp's Ten Security Steps:
http://www.ltcomputerdesigns.com/Security.htm

Joan Wild's Tips:
http://www.jmwild.com/security02.htm

The Security Whitepaper is also worth reading:
http://support.microsoft.com/?id=148555

Keith Wilby's Instructions (See step-by-step link)
http://www.keithwilby.com/

Other Good Information:
http://www.access-experts.com/default.aspx?selection=TutorialSecurity&sm=18

Other Microsoft KB articles of interest:
Description of how to help protect a Access 2000 database:
http://support.microsoft.com/?id=254372

Description of the role of workgroup information files in Access 2000 security:
http://support.microsoft.com/?id=305541

--
Jeff Conrad
Access Junkie
Bend, Oregon

Hi Jeff,

Thanx a lot for the help, I made the changes today and worked just fine...

Thanx to both of you, I still have to read all about access security just in
case I really want to make something more serious.

Jeff Conrad said:
Hi Al,

-Trying again, because my posts are not going through-

I would have to agree with Rick on this issue.

Any kind of "Developer-implemented" security/password
schemes are really not all that secure. Implementing full-
blown Access User Level Security is really the *best* way
to go if you want to have some security built into your
application. It is a difficult and challenging task to implement
the first couple of times, so it is best to thoroughly read up
on the subject before beginning and practice on "dummy"
databases. If you would like some links on the subject, post
back and I'll provide a few for you.

OK, having said the above, I also believe that there are times
and places when ULS is way too much overkill. If the data
is not ultra-sensitive and/or you have really low-tech users, a
*simple* security system can be more than sufficient. I have
done this before many times in the past.

So what you are looking for is to integrate something with the
built-in Switchboard Manager, correct? Here is a past post of
mine on this subject (modified just a bit) which should do exactly
what you are looking for. As long as you the developer fully
understand the limitations of this setup, then you may proceed.
Make a backup of your database BEFORE beginning!

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

This assumes that the Admin Switchboard area you want to
protect is number "2" in the Switchboard Items TABLE. Make
sure to change that number to whatever matches your table
value. This also assumes that the NAME of your switchboard
form is actually just "Switchboard." Change the code if
you have changed the name. Dress up the message box with
whatever formatting and/or messages you desire.

Use the Switchboard Manager Wizard to create the entry to
go to this Admin area. Instead of using the option that
opens up a Switchboard, make it open the frmPassword
instead. Like this:

Edit Switchboard Item:
Text: Go To Admin Area
Command: Open Form In Add Mode
Form: frmPassword

Now when the person clicks on the Switchboard option that
says "Go To Admin Area" the Password form opens up on top.
Unless they enter the correct password, the Switchboard
will not change to show the Admin menu. It would also be a
good idea to hide the Database Window from the users.
Hope that gets you going,
--
Jeff Conrad
Access Junkie
Bend, Oregon

Al said:
Being a brand new user of Access (A-2000)and a real noob on VB, I'm having
the worst of my time trying to make a "special menu" using switchboard
manager. I've figured out everything I want my db to do, but still haven't
been able to put 2 buttons on the first (of 3) switchboard in which the user
would pick either of them and ask him to input a password to redirect him to
the next "protected" switchboard.

Objective.- To have a switchboard that will enable a user to access an
"admin switchboard" through a password.

I've seen the code of the switchboard form,and even seen some codes online
on how to make a button (any button) ask for a password, but the way the
manager arranges the switchboard form (creating a table) makes it impossible
(to me) to get that "online aquired code" IN my switchboard manager made
form...
 

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

Similar Threads


Top