H
hughess7
Hi
I have a database in Access 2003 split between FE and BE. I need to know who
is logged in so I can ask them to exit the application. We do not use the
security logon in Access so I am trying to do it utilising the fOSUserName()
function. I have captured the login by entering code in the open event of the
startup form (although this won't capture if a user bypasses startup withthe
shift key will it?). I have added code to the Exit button on the same form to
capture the Logout but this bit is not working.
code:
CurrentDb.Execute "UPDATE tblUsers " & _
"SET LogoutTime = #" & Now() & "# " & _
"WHERE UserName = '" & sUserName & "' AND LoginTime = #" & _
DMax("LoginTime", "tblUsers", "UserName = '" & _
sUserName & "'") & "#;", dbFailOnError
Is there something wrong with this code or is it because I put it before the
quit command that it isn't writing to the table?
Thanks in advance for any help.
Sue
I have a database in Access 2003 split between FE and BE. I need to know who
is logged in so I can ask them to exit the application. We do not use the
security logon in Access so I am trying to do it utilising the fOSUserName()
function. I have captured the login by entering code in the open event of the
startup form (although this won't capture if a user bypasses startup withthe
shift key will it?). I have added code to the Exit button on the same form to
capture the Logout but this bit is not working.
code:
CurrentDb.Execute "UPDATE tblUsers " & _
"SET LogoutTime = #" & Now() & "# " & _
"WHERE UserName = '" & sUserName & "' AND LoginTime = #" & _
DMax("LoginTime", "tblUsers", "UserName = '" & _
sUserName & "'") & "#;", dbFailOnError
Is there something wrong with this code or is it because I put it before the
quit command that it isn't writing to the table?
Thanks in advance for any help.
Sue