stevekos07
Registered User.
- Local time
- Yesterday, 17:28
- Joined
- Jul 26, 2015
- Messages
- 174
I am trying to set up a dynamic logged-in user table where I can keep tabs on who is logged in to a database. I have some of the system working, but the last bit is not working for me.
Currently I have:
a "frmLogin" with txtUserName and a txtUserID fields. The AfterUpdate event on the txtUserName creates a temporary variable tmpUser.
The OK button runs a script that does all the checking of their username, password etc. and this works fine.
At the end of all this the last line is a command to open a hidden form frmUserLoginHidden, with two text boxes - txtUserName and txtUserID.
The OnOpen event of the hidden form sets the value of txtUserName as the temp variable tmpUser. This works ok.
I can then view the logged in user in the table/form ok. This part works fine.
Then I have a delete query that is called on the OnClose event of the hidden form. This is the SQL:
DELETE tblLoggedOnUser.DateTime, tblLoggedOnUser.UserName
FROM tblLoggedOnUser
WHERE (((tblLoggedOnUser.UserName)=[Forms]![frmUserLoginHidden]![UserName]));
My understanding is that all I need is one field identified in the record to delete the entire record with a delete query, but I have identified two.
This delete query fails to delete the record in the tblLoggedOnUser.
Any ideas?
Currently I have:
a "frmLogin" with txtUserName and a txtUserID fields. The AfterUpdate event on the txtUserName creates a temporary variable tmpUser.
The OK button runs a script that does all the checking of their username, password etc. and this works fine.
At the end of all this the last line is a command to open a hidden form frmUserLoginHidden, with two text boxes - txtUserName and txtUserID.
The OnOpen event of the hidden form sets the value of txtUserName as the temp variable tmpUser. This works ok.
I can then view the logged in user in the table/form ok. This part works fine.
Then I have a delete query that is called on the OnClose event of the hidden form. This is the SQL:
DELETE tblLoggedOnUser.DateTime, tblLoggedOnUser.UserName
FROM tblLoggedOnUser
WHERE (((tblLoggedOnUser.UserName)=[Forms]![frmUserLoginHidden]![UserName]));
My understanding is that all I need is one field identified in the record to delete the entire record with a delete query, but I have identified two.
This delete query fails to delete the record in the tblLoggedOnUser.
Any ideas?