RossWindows
Que?
- Local time
- Today, 14:54
- Joined
- Feb 25, 2008
- Messages
- 410
I have a table called active users which has an autonumber field called Session and the table also stores the username and date.
The record is appended to the table when the user opens the db.
That works fine.
What I need now, is when the user closes the main form (which causes an application.quit) I want the forms on close event to run a delete query to remove the user from the ActiveUsers table.
This is what I have so far, but it seems not to work:
I think one problem is incorrect syntax for referring to the Public "Session" variable...
The record is appended to the table when the user opens the db.
That works fine.
What I need now, is when the user closes the main form (which causes an application.quit) I want the forms on close event to run a delete query to remove the user from the ActiveUsers table.
This is what I have so far, but it seems not to work:
I think one problem is incorrect syntax for referring to the Public "Session" variable...
Code:
DoCmd.RunSQL "DELETE ActiveUsers.*, ActiveUsers.Session" & _
" FROM ActiveUsers" & _
" WHERE (((ActiveUsers.Session)=[Session]));"