Users log

  • Thread starter ladybug via AccessMonster.com
  • Start date
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!
 
M

mscertified

Why are you doing this?
You don't need a 'userid', since you can capture the users windows logon id.
Passwords will not be secure in an Access database.
Your code will not work if the users exit without closing down the
application (and believe me it happens all the time).
If you want to know who is logged on at any point in time you can use the
LDBVIEW utility, but even that is not foolproof.

-Dorian
 
L

ladybug via AccessMonster.com

That is how the security was set up before me. It seems to work just fine
within our team. I am sorry I do not know what LDBVIEW utility is.
Why are you doing this?
You don't need a 'userid', since you can capture the users windows logon id.
Passwords will not be secure in an Access database.
Your code will not work if the users exit without closing down the
application (and believe me it happens all the time).
If you want to know who is logged on at any point in time you can use the
LDBVIEW utility, but even that is not foolproof.

-Dorian
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
[quoted text clipped - 34 lines]
Can someone help me or give suggestions on how to link these together so I
can track when each login is used. Thanks!
 
M

mscertified

If you need this just for security, why have a userid and password at all?
Just detect the users windows logon id and then check it against a table of
users. If its not there, reject the user.
Use fosUserName function to get the userid (look on Google)

-Dorian

ladybug via AccessMonster.com said:
That is how the security was set up before me. It seems to work just fine
within our team. I am sorry I do not know what LDBVIEW utility is.
Why are you doing this?
You don't need a 'userid', since you can capture the users windows logon id.
Passwords will not be secure in an Access database.
Your code will not work if the users exit without closing down the
application (and believe me it happens all the time).
If you want to know who is logged on at any point in time you can use the
LDBVIEW utility, but even that is not foolproof.

-Dorian
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
[quoted text clipped - 34 lines]
Can someone help me or give suggestions on how to link these together so I
can track when each login is used. Thanks!
 
R

Ron2006

The disadvantage of the logon id solution is that if my computer is
dead or occupied, then I CANNOT sit at a different computer and do my
work unless I am logged on to the network on that computer using my
own ID.

Also my backup cannot do my work from their computer without logging
in as me on their computer or on my computer.

Just food for thought.

Ron
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top