By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,986 Members | 1,944 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,986 IT Pros & Developers. It's quick & easy.

How to add a password to 1 switchboard option

P: 1
Hello,
I am somewhat a newbie to Access and am trying to find out if there is a way to isolate one button on the switchboard with a password? That one switchboard option leads to another list of options that I don't want accessible to anyone else but my small department.

I have looked in several reference books and many different places but haven't found how to do that particular thing. Thanks! ---Dina
Oct 25 '06 #1
Share this Question
Share on Google+
3 Replies


NeoPa
Expert Mod 15k+
P: 31,347
Have the On Click property point to a procedure (subroutine) which, instead of calling the restricted form directly, uses an
Expand|Select|Wrap|Line Numbers
  1. InputBox(prompt[, title] [, default] [, xpos] [, ypos] [, helpfile, context])
call first to get a string which can be compared to your correct password.
Then, only call the restricted form if the password is correct.
Oct 25 '06 #2

MMcCarthy
Expert Mod 10K+
P: 14,534
Hello,

I am somewhat a newbie to Access and am trying to find out if there is a way to isolate one button on the switchboard with a password? That one switchboard option leads to another list of options that I don't want accessible to anyone else but my small department.

I have looked in several reference books and many different places but haven't found how to do that particular thing. Thanks! ---Dina
In the current on click event of the button you have something like:

=HandleButtonClick(1)

Change this to [Event Procedure]

Write your code to get password

if password is correct put

HandleButtonClick(1)

Else give warning message

The only problem with this is that this button number will always behave like this on the switchboard
Oct 26 '06 #3

P: 3
Put this code behind a conrtol button on your form:

Private Sub Command148_Click()
On Error GoTo Err_Command148_Click

Dim stDocName As String
Dim stLinkCriteria As String
Dim strForm As String

strForm = "frm_Password"
DoCmd.OpenForm strForm, , , stLinkCriteria, , acDialog

If strPassword = "reviewer" Then
stDocName = "frm_Ser_needed"
DoCmd.OpenForm stDocName, , , stLinkCriteria
End If

Exit_Command148_Click:
Exit Sub

Err_Command148_Click:
MsgBox Err.Description
Resume Exit_Command148_Click

End Sub

This will generate a security box (hopefully) which when filled in with
the password will open the secured form.
Good luck.
Oct 27 '06 #4

Post your reply

Sign in to post your reply or Sign up for a free account.