Cynthia_D
02-06-2001, 11:02 AM
I have one main switchboard which has multiple switchboards attatched to it. I want to be able to put individual passwords on the different switchboards. Is this possible?
Any help would be great.
ElsVanMiert
02-06-2001, 11:27 AM
It is possible but you need to carefully plan your security plan. My technique in those cases: I check the group of the user and decide whether he has access or not. You should NOT hardcode this information.
Cynthia_D
02-07-2001, 04:04 AM
Thanks. I have set up user and group accounts. I am a little unsure of how to activate them though. Ideally I would like people to be prompted to enter their username and password when entering different forms. Is that possible?
Talismanic
02-07-2001, 08:35 AM
Check this thread for my quick and dirty way of doing this and some comments from others about this method.
binding a password to a cmd button (http://www.access-programmers.co.uk/ubb/Forum1/HTML/002639.html)
I am not working with a bunch of hackers/crackers so this method works very well. If your users are at the beginner to intermedite level it should work for you also. If you need to beef it up a little you can use simongallop's suggestion of converting it to a MDE.
Talismanic
02-07-2001, 08:38 AM
If you don't want to go through the thread, here is the code:
Dim strPasswd
strPasswd = InputBox("Enter Password", "Restricted Form")
If strPasswd = "YourPassWord" Then
' Open specific form here.
Else
Exit Sub
End If
Cynthia_D
02-08-2001, 05:20 AM
Is the code above supposed to be a module? I tried using it there and nothing happened. Please help.
Talismanic
02-08-2001, 06:53 AM
Cynthia_D,
Probably the easiest thing to do would be do put it in the On_Click event that opens up your secondary switch board. The way it is written here you would need to put it behind each button that opens up a sub switchboard. It may be a little redundant but it will give you the flexibility of using a different password for each switchboard in your project.
Then all you have to do is modify the YourPassWord and then put the Open secondary switchboard command you are using now where I put the " ' Open specific form here".
Also to make it a little more user friendly you could put a message box between the Else and Exit Sub like this:
Else
MsgBox "The Password you entered is incorrect!" & vbCrLf & _
"Please try another", vbCritical, "Password Error"
Exit Sub
[This message has been edited by Talismanic (edited 02-08-2001).]