Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to update a table on close/exit of the database?? 1

Status
Not open for further replies.

flip79

MIS
Jul 5, 2002
23
0
0
US
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.
 
Just a little design issue. Do you have a main form or switchboard form to help the users navigate in the database? If you have a main form then add a 'Quit' button and write you code in the Click event before using Application.Quit. You can't determine when someone Ctrl+Alt+Del from the database if they are hung up. If you have disciplined users you probably don't need to disable the control buttons that quit an application.
-------------------------------------
scking@arinc.com
Try to resolve problems independently
Then seek help among peers or experts
But TEST recommended solutions
-------------------------------------
 
flip, here's a thread that I found helpful a few weeks ago when I was trying to do this exact same thing. thread181-459087 Maq [americanflag]
<insert witty signature here>
 
Yes, I do have a main (switchboard form), and I also have quit buttons on all forms of the database. My concern is what if they click the X (close button) on the top right corner of the database. Does the 'Quit' button still execute the code behind it? I don't think the users are very disciplined to use the &quot;Close Access&quot; button I made, and I've already dimmed the close buttons on the form. Is there some kind of macro that will run on close of the database kind of like the autoexec macro that runs when the database is opened.
 
Thanks for the link, Maq! I'm looking foward to working on it!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top