Connecting Tech Pros Worldwide Forums | Help | Site Map

Compacting a database on close

ColinWard
Guest
 
Posts: n/a
#1: Nov 12 '05

Hi I have a database that I would like to be able to compact when the
exit button on the main form is clicked. Can anyone help with this?

TIA

Colin


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Wayne Morgan
Guest
 
Posts: n/a
#2: Nov 12 '05

re: Compacting a database on close


If you are the only one with the database open and if you have Access 2002 (and perhaps
2000, I don't remember), one of the options under Tools|Options is Compact On Close. DON'T
try compacting a database that someone else may have open.

--
Wayne Morgan


"ColinWard" <cward@nospam.com> wrote in message
news:3f7de16f$0$202$75868355@news.frii.net...[color=blue]
>
> Hi I have a database that I would like to be able to compact when the
> exit button on the main form is clicked. Can anyone help with this?[/color]


Tony Toews
Guest
 
Posts: n/a
#3: Nov 12 '05

re: Compacting a database on close


ColinWard <cward@nospam.com> wrote:
[color=blue]
>Hi I have a database that I would like to be able to compact when the
>exit button on the main form is clicked. Can anyone help with this?[/color]

When the user exits the FE attempt to rename the backend MDB preferably with todays
date in the name in yyyymmdd format. Ensure you close all bound forms, including
hidden forms, and reports before doing this. If you get an error message, oops, its
busy so don't bother. If it is successful then compact it back.

See my Backup, do you trust the users or sysadmins? tips page for more info.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Closed Thread