L
ladybug via AccessMonster.com
I have an unbound form with two text boxes. The first text box is for login
and the second text box is for password. The command button on the form has
this code in the On Click:
If IsNull(Forms!frm_login!txt_login) Then
MsgBox "Login is blank. Please enter login id.", vbCritical, "Login
Error"
Else
If IsNull(Forms!frm_login!txt_pw) Then
MsgBox "Password is blank. Please enter password.", vbCritical,
"Password Error"
Else
DoCmd.OpenForm "frm_auth"
If Forms!frm_auth!frm_login_auth!Authorized = 0 Then
MsgBox "The Login or Password you entered is not valid.
Please try again.", vbCritical, "Invalid User"
DoCmd.Close acForm, "frm_auth", acSavePrompt
DoCmd.Close acForm, "frm_login", acSavePrompt
DoCmd.OpenForm "frm_login"
Else
myLogin = Forms!frm_auth!frm_login_userrole!Login
myRole = Forms!frm_auth!frm_login_userrole!Role
DoCmd.Close acForm, "frm_auth", acSavePrompt
DoCmd.Close acForm, "frm_login", acSavePrompt
DoCmd.OpenForm "Switchboard"
End If
End If
End If
I have a table called tbl_worker with the following fields: worker_id
(Autonumber), login, full_nm, role, and pw.
I have created a new table (tbl_entry)to track when users log in. It has
three fields: enter_id (autonumber), worker_id (number), and enter_dt(date).
The date is set to =now().
Can someone help me or give suggestions on how to link these together so I
can track when each login is used. Thanks!
and the second text box is for password. The command button on the form has
this code in the On Click:
If IsNull(Forms!frm_login!txt_login) Then
MsgBox "Login is blank. Please enter login id.", vbCritical, "Login
Error"
Else
If IsNull(Forms!frm_login!txt_pw) Then
MsgBox "Password is blank. Please enter password.", vbCritical,
"Password Error"
Else
DoCmd.OpenForm "frm_auth"
If Forms!frm_auth!frm_login_auth!Authorized = 0 Then
MsgBox "The Login or Password you entered is not valid.
Please try again.", vbCritical, "Invalid User"
DoCmd.Close acForm, "frm_auth", acSavePrompt
DoCmd.Close acForm, "frm_login", acSavePrompt
DoCmd.OpenForm "frm_login"
Else
myLogin = Forms!frm_auth!frm_login_userrole!Login
myRole = Forms!frm_auth!frm_login_userrole!Role
DoCmd.Close acForm, "frm_auth", acSavePrompt
DoCmd.Close acForm, "frm_login", acSavePrompt
DoCmd.OpenForm "Switchboard"
End If
End If
End If
I have a table called tbl_worker with the following fields: worker_id
(Autonumber), login, full_nm, role, and pw.
I have created a new table (tbl_entry)to track when users log in. It has
three fields: enter_id (autonumber), worker_id (number), and enter_dt(date).
The date is set to =now().
Can someone help me or give suggestions on how to link these together so I
can track when each login is used. Thanks!