User Help

Soulium

Registered User.
Local time
Today, 20:37
Joined
Sep 9, 2008
Messages
57
Whats the best way to set up Users? I have never done it before :o
 
Can you be a bit more specific? Do you mean in the security schema? If so then one option is to align roles, and hence permissions along organizational lines. Say if you have warehouse workers then that would be a role, if there are middle managers then that would be a role. Users are place in roles and roles then are given permissions to objects such as tables and forms. Etc.,etc...
 
Sorry, I have found most of it out now ( I am at work and having to juggle things around - this is the first chance I have had to get back on the forum). I have created a table for users and have made a login form that they input their name in and enter their password and if the info is correct logs them in. Am just tinkering around with what form they go to depending on what level access they have. Thanks for trying to help though, this forum/community is really nice which is great! :)
 
Sorry for double post but i needed to bump this topic.


Right, I have a table called tblUsers. This has UserID, UserName, UserPassword and UserLevel.

I have then created a login screen where the users choose their ID and enter their password, they then click login which Dlookups their information and makes sure its correct. What i want it to do is also look up their user level and take them to the relevent form.

E.g.

User 1 has a user level of 2
User 2 has a user level of 1

User 1 and 2 entres their login information and the systems check their details, User 1 is taken to frmMB1 User 2 is taken to frmMB2.

This is what i have so far:

Private Sub cmdLogin_Click()

If IsNull(Me.cboUsers) Or Me.cboUsers = "" Then
MsgBox "You must select a User Name.", vbOKOnly, "Required Data"
Me.cboUsers.SetFocus
Exit Sub
End If

If IsNull(Me.txtPassword) Or Me.txtPassword = "" Then
MsgBox "You must enter your Password.", vbOKOnly, "Required Data"
Me.txtPassword.SetFocus
Exit Sub
End If

If Me.txtPassword.Value = DLookup("UserPassword", "tblUsers", _
"[UserID]=" & Me.cboUsers.Value) Then

MyUserID = Me.cboUsers.Value

DoCmd.Close acForm, "frmUserLogin", acSaveNo


Else
MsgBox "Password Invalid. Please Try Again", vbOKOnly, _
"Invalid Entry!"
Me.txtPassword.SetFocus
End If

intLogonAttempts = intLogonAttempts + 1
If intLogonAttempts > 3 Then
MsgBox "You do not have access to this database.Please contact admin.", _
vbCritical, "Restricted Access!"
Application.Quit
End If

End Sub


p.s. im a noob at Access VB code. lol
 
Bump

And i am using Access 2003 :)


Edit:

Have found a better way so no need for reply. Thanks.
Matt
 
Last edited:
If you are interested in applying a better user level security then check out this link, but make sure that you fully understand that pdf file before trying to implement as you might end up locking yourself out of your databases.

Gooduck.
 

Users who are viewing this thread

Back
Top Bottom