furnitureheaven
Registered User.
- Local time
- Today, 07:36
- Joined
- Aug 5, 2008
- Messages
- 36
hi
Hi
I am new in access, I have a database in access and design some forms, I have just create a user login form. If user “Akoo” login the “frm_sara” will open and other user login with user name and password then “frm_lynn” should open. I have tried but due to limited knowledge in access, could not successful.
here is a VBA Code, for login authantication.
On form there a combo box for user name and text box for password. the following code is run on Command button. In database there is a 4 column,
UserID
Name
Password
SecurityLevel
so what is want if UserID is 1 then open frm_Sara and if its 2 then open frm_Lynn.
Hi
I am new in access, I have a database in access and design some forms, I have just create a user login form. If user “Akoo” login the “frm_sara” will open and other user login with user name and password then “frm_lynn” should open. I have tried but due to limited knowledge in access, could not successful.
here is a VBA Code, for login authantication.
On form there a combo box for user name and text box for password. the following code is run on Command button. In database there is a 4 column,
UserID
Name
Password
SecurityLevel
so what is want if UserID is 1 then open frm_Sara and if its 2 then open frm_Lynn.
Code:
If DLookup("Password", "Users", "[Name]=" & Me.user_id.Value) Then
Name = Me.user_id.Value
'DoCmd.OpenForm "frm_sara", acNormal = acNormal
'Close logon form and open splash screen
DoCmd.SetWarnings (0)
DoCmd.Close acForm, "frm_main", acSaveNo
DoCmd.OpenForm "frm_sarah"
Else
MsgBox "Password Invalid. Please Try Again", vbOKOnly, "Invalid Entry!"
Me.password.SetFocus
End If