Question Compact & repair (1 Viewer)

Dezirous

Rafi Ahmed
Local time
Today, 10:32
Joined
Jul 8, 2009
Messages
71
Hi Experts,
My question is that is there any way to use Compact & Repair tool using Button in form, when ever I press that button, it should call main Compact & Repair tool directly because if I disable the FULL Toolbar option in my project, it also blocks the tool menu and Compact & Repair option as well. Kindly help, thanks in advance.
 

John Big Booty

AWF VIP
Local time
Today, 17:32
Joined
Aug 29, 2005
Messages
8,263
You can use the following method to automatically compact and repair the DB every time it is closed.

Or have a look at this thread


Compacting does not occur if you close a shared Access database (multiuser (shared) database: A database that permits more than one user to access and modify the same set of data at the same time.) while another user has it open.

1. Open the Access database or Access project that you want Microsoft Access to compact automatically.
2. On the Tools menu, click Options.
3. Click the General tab.
4. Select the Compact on Close check box.

Note You can stop the compact and repair process by pressing CTRL+BREAK or ESC.
 

Dezirous

Rafi Ahmed
Local time
Today, 10:32
Joined
Jul 8, 2009
Messages
71
I got u John but my question is different from this thread. I want a button for COmpact & Repair in form view with its code or link with any macro just like REFRESH button in navigation. My Database is not on sharing, it is on single use.
 

John Big Booty

AWF VIP
Local time
Today, 17:32
Joined
Aug 29, 2005
Messages
8,263
Try reading through the second link I posted above. I believe that you will find a solution there.
 

Dezirous

Rafi Ahmed
Local time
Today, 10:32
Joined
Jul 8, 2009
Messages
71
John I found 2 links on that post which you linked but both are unavailable. 1 is show page unavailable and 2nd is show 404 error msg of unavailability, plz send me another link if you know.
 

John Big Booty

AWF VIP
Local time
Today, 17:32
Joined
Aug 29, 2005
Messages
8,263
Just checked and both links work fine. The second is to a thread in this forum, so I suspect you have a problem with your internet connection.

From that link try this code;
Code:
SendKeys "%(TDC)", False
The code is not mine and I have not tested it, so can not vouch for it's efficacy.
 

Dezirous

Rafi Ahmed
Local time
Today, 10:32
Joined
Jul 8, 2009
Messages
71
Man that's really working............
SendKeys "%(TDC)", False
I was talking about 2 links that I found inside threads and they are not working.......... your link are working fine................
Thanks a lot man............... you helped me again.............
 

John Big Booty

AWF VIP
Local time
Today, 17:32
Joined
Aug 29, 2005
Messages
8,263
Glad you got it working :)

This question should probably have been asked right up front; Why do you need to do Compact and repair at the click of a button?

In most cases, I would have thought a periodic Compact and repair would have been sufficient, and were it wasn't a Compact and repair on shut down would cover most other contingencies.
 

Dezirous

Rafi Ahmed
Local time
Today, 10:32
Joined
Jul 8, 2009
Messages
71
Actually the database has to remain open all day about 12 to 14 hours and there is no need to close it but data entries are made about 200 to 300 per day, that's why, I need to insert this option to stabilize my project and to secure less space as well. :)
 

John Big Booty

AWF VIP
Local time
Today, 17:32
Joined
Aug 29, 2005
Messages
8,263
Are these simple additions of data to the DB? Or does that include modifications and deletions. As it is the modification and deletions of records that will cause the biggest waste of space. If the records are simply being added and not modified or deleted your gains in space saving will be minimal.
 

Dezirous

Rafi Ahmed
Local time
Today, 10:32
Joined
Jul 8, 2009
Messages
71
No John, it's a modification of data and addition as well, but delete system is blocked and a new system just like delete I introduced that is hiding of data with help of query criteria, user thinks that data has been deleted but its not actually. it just hide from data form on which he or she works. Only administrator that is me, can see that records that have been hidden so these can be restored if required. Does this sound's good? :)
 

Users who are viewing this thread

Top Bottom