rakurai
07-16-2007, 08:41 AM
There is essentially two different types of users that will be accessing my database. One is the Admin, who has access to everything, and the other is the Guest, who only has read access. This is all fine and well, but I am wondering if there is a way to alter the login prompt so the user can choose between the two options instead of having to type it in. Like, have a list, dropdown, or some sort of button. I want to do this so nobody has to remember what they have to type in to gain their correct access. Is this possible?
boblarson
07-16-2007, 10:17 AM
How are they logging in so that you know who gets what access level?
If it is generic - two logins, one for admin, one for guest, just set a boolean flag (Public blnAdmin As Boolean) in the general declarations section of a standard module and then when they log in
If Me.txtPassword = "WhateverAdminPassword" Then
blnAdmin = True
End If
Then when they open things you can use
If blnAdmin Then
...do things if they are admin
Else
...do things if they aren't admin
End If
But, they will need to have their own copy of a front end to do this, otherwise when someone else logs in, it will possibly change the access level.
You really need to have a front-end/back-end setup anyway (for shared use) and the users should all have their own front-ends. It will prevent corruption from happening, as well as make the code work.
You can find an Auto Updating tool (in the Sample databases category) that I wrote to enable front-ends to be automatically updated from your master when you make changes to it, so that you and your customers never have to worry about manually making sure that the front end they have is up to date.
rakurai
07-16-2007, 11:21 AM
Thank you for your reply, Bob. They are logging in by just typing either Admin or Guest and the password. The login prompt that I was talking about is the one that pops up due to the settings under "User and Group Permissions". It's just the dialog box that has fields for Name and Password. I thought perhaps there was a way to alter that. But I will look into your suggestions. Thanks.
Dennisk
07-16-2007, 10:47 PM
if you are referring to a workgroup protected db then you HAVE to type in the password as that is part of the security. Otherwise you will have to develop your own which wouldn't stop me from gaining access to your db, but would detere others.