Compact On Close

R

rocco

Hello,
newby here... so take it easy.
I want my database compact on close since it is an application which deals
with lot of insert/delete kind of things.
I checked the option compact on close.
Users can only exit the appliocation by clicking on a button.
The click event has just a line:
application.quit

Now, talking about 'compacting on close' I don't think that by quitting the
application is the same as closing the db. I means, it doesn't seem to
compact. I cannot be sure, I can just tell this because it seems the db
doesn't take any little 'extra' time to close. meaning he is doing
something...
I'm I right?
Nico
 
R

ruralguy via AccessMonster.com

The db should C&R regardless of how you quit as long as it is using some
normal close of Access.
 
L

Linq Adams via AccessMonster.com

But you need to understand compacting can lead to corruption and should only
be done after backing up your database! C & R on Close was not one of Micro
$oft's better idea!
 
J

Jonathan

rocco said:
Hello,
newby here... so take it easy.
I want my database compact on close since it is an application which deals
with lot of insert/delete kind of things.
I checked the option compact on close.
Users can only exit the appliocation by clicking on a button.
The click event has just a line:
application.quit

Now, talking about 'compacting on close' I don't think that by quitting the
application is the same as closing the db. I means, it doesn't seem to
compact. I cannot be sure, I can just tell this because it seems the db
doesn't take any little 'extra' time to close. meaning he is doing
something...
I'm I right?
Nico

Nico,

This will not work if more than one person has this same user interface
open. That is, if more than one person can use the database concurrently,
Then each user should have their own copy of the user interface that is
linked to a common/shared data file.

Each copy can then compact on closing; no matter how the quit is initiated.

Luck
Jonathan
 
Q

Qdxss2b via AccessMonster.com

Nico,

What you can try is to create a macro that will run when you exit the program.


Name the macro something like "mExit", just makes it easy to find.

You will then need to put in these two lines:

SendKeys: %tdc
RunCommand: Exit

This will compact and repair your database everytime you close it.

Ray
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top