Simple button click to compact and repair current DB (1 Viewer)

FrostByte

Registered User.
Local time
Today, 18:26
Joined
Jan 15, 2015
Messages
56
Hi,

This is turning out to be very difficult.

I simply want a button that when clicked will compact and repair the current opened database but without using sendkeys.

Thats it, but all the code I can find appears very complex.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 10:26
Joined
Oct 29, 2018
Messages
21,467
Hi. If your database is split, there is no need for this. You simply replace the FE with a fresh copy from the master.
 

isladogs

MVP / VIP
Local time
Today, 18:26
Joined
Jan 14, 2017
Messages
18,213
If you have A2010 or later, you can no longer compact the current database using VBA.
The feature was removed possibly because it can cause corruption.
A better method is to compact on close if the database exceeds a certain specified size.
But I would recommend making a backup then compacting...just in case.
 

Mark_

Longboard on the internet
Local time
Today, 10:26
Joined
Sep 12, 2017
Messages
2,111
From a design standpoint, what advantage would you have doing a C&R while using the database rather than doing so when you close it? I am guessing this is for a front end that has temp tables?
 

Users who are viewing this thread

Top Bottom