How can I know when a user is exiting a database, and write code to update a table before the database closes? I have a database where a user logs in as a certain user type. When a user logs in, I update a yes/no field that says whether or not a user of the same type is logged in. That way if the yes/no field is yes, a message will appear to the user that someone of the same user type is already logged on. My problem is that I don't know how to change the yes/no field back no when the database is closed. I save the user type in a string in a single module, so I know what user type is logged in at a particular time. Any ideas???? Thanks for any help.