preventing Autoexec macro from running after Compact & Repair

Seems such a simple thing, but I can't find the answer anywhere.

Every time I Compact & Repair, my Autoexec macro runs again. Is there a way to prevent it from running here, as part of the reason for compacting is to get the file size back down again after the Autoexec has deleted a lot of rows.


You could rename the macro when you don't want it to operate as an autoexec macro.

DoCmd.Rename "disableAutoExec", acMacro, "AutoExec"

And rename it back to AutoExec when you do want it to behave as an autoexec macro.

If that suggestion isn't satisfactory, you could have the macro check for the presence of a file, disableAutoExec.txt, and do nothing when that file exists.

Delete the file when you do want AutoExec to do everything it's set up to do.

Or instead of a file as a flag to control whether AutoExec should proceed, you could store the flag value in a table.

an old one that works (in MS Access 2010 and before at least) is to hold down the shift key when opening the database

Need Your Help

Choosing a Perl GUI Module for maximum cross platform usage

perl user-interface qt gtk

I'm working on a couple of personal project to improve my Perl skills. Among other things they need to provide a GUI interface on different OSes. In the past what little GUI work I did on Perl us...

uniform generation of points on 3D box

opengl 3d geometry trigonometry particles

I would like to generate random points on a 3D box defined by its (minx, miny, minz) and (maxx, maxy, maxz) corners. I was thinking of generating a random point inside of the box and then somehow