Macro needed on close of database file

stafire_18

Board Regular
Joined
Dec 8, 2004
Messages
162
i need a code that will run a macro when the database is closed. if you have one, will this work if the "X" in the very top right hand corner is selected? or just if it's attach to a command button? Right now i have this macro as an autoexec but found some errors when multiple users open up the mdb.
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
If you open a form that is hidden when the database opens, then as the database is closed, that form will be closed, thereby giving you (your application) that the database is closing. If you need to keep tract of how many people are signed on to the database, then you can keep count in a table as the form is opened and as it is closed. When closing and the table shows this to be the last person signed on, do whatever it is you need to do.
HTH
 
Upvote 0
A little more info in case you need it about multiple people being signed on at the same time. This was supplied by CT Witter in this thread

Check out these Microsoft KB Articles, depending on your Version:
2000
How to determine who is logged on to a database by using Microsoft Jet UserRoster in Access 2000
http://support.microsoft.com/kb/198755

XP(2002) or 2003:
How to determine who is logged on to a database by using Microsoft Jet UserRoster in Access 2002 or in Access 2003
http://support.microsoft.com/kb/285822

HTH,
CT
 
Upvote 0

Forum statistics

Threads
1,214,576
Messages
6,120,354
Members
448,956
Latest member
Adamsxl

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top