Compact and repair

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi
I need to add a condition before Compact and repair.Can anyone help me where
to insert it? I'm very new to VBA.
Thanks
 
Hi Rick
When user goes to Tools - Database Utilities - Compact and Repair. I need to
add a condition here, before Compact and Repair is executed. Simple If
statement. But I don't know where to find this Compact and Repair in VBA.

Thanks
Barb
 
Again, what statement? What could you possibly want to check before doing
this?

I am pretty sure that there is no place where you can do so, but was
curious.

Rick B
 
It sounds to me like you would need to turn off the default Database toolbar
and turn on a replacement custom toolbar (myDatabase) that is a copy of the
Database toolbar. In the Compact and Repair menu item of the myDatabase
toolbar, you'd run code that incorporated your If statement before calling
the action of traditional Compact and Repair. This coding is way over my
head, but perhaps someone else is familiar with it could jump in ...

I hope this helps reframe the problem.

Kevin
 
I'm pretty sure there is no way to intercept the Compact and repair command
in the menu. Instead you need to take a different approach to this. Setup a
custom toolbar with a custom button or a command button on an administration
form. When the user clicks the button run your if statement in the button
click event and then run the compact and repair.

This link should take you to the MSDN article on compacting the database
with ADO. http://support.microsoft.com/default.aspx?scid=kb;en-us;230501
If it doesn't search on the following "ado compact database".

To prevent your users from going around your if statement hide all toolbars
and menus. You can do this in Tools and then Startup.

~Mark
 
Back
Top