Capture Logout

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
 

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