Group:  Microsoft Access ยป microsoft.public.access.gettingstarted
Thread: Command Button: compact data and quit application

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

Command Button: compact data and quit application
"SilviHaiku" <sdrsolo[ at ]openface.ca> 03.09.2006 14:37:03
Greetings to all participants.

I run an Access97 database.

I have created a command button on Form-A: clicking this button quits the
application.

Now, I would like to add a Compact-Data-Before-Quitting function to this
button. How could I do this?

Of course, I know there is a Compact Data Option in the Tools menu but this
database runs on a network and 3 office colleagues connect to input data and
populate the fields. That is why I would like this Command Button to a)
compact data and b) quit the application.

Thanks for sharing and assisting.

Sylvie


Re: Command Button: compact data and quit application
"Douglas J. Steele" <NOSPAM_djsteele[ at ]NOSPAM_canada.com> 03.09.2006 15:27:27
Is your application split into a front-end (containing the queries, forms,
reports, macros and modules), connected to a back-end (containing the tables
and relationships), the way it should be? If so, you can check whether the
locking file for the back-end database exists (the .LDB file in the same
folder as the .MDB) and use the CompactDatabase method of the DBEngine
object. What I typically do is rename the existing back-end as a backup,
then run CompactDatabase on that renamed file, creating the "correctly
named" file as the result.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"SilviHaiku" <sdrsolo[ at ]openface.ca> wrote in message
news:%23$iApW2zGHA.4796[ at ]TK2MSFTNGP06.phx.gbl...
[Quoted Text]
> Greetings to all participants.
>
> I run an Access97 database.
>
> I have created a command button on Form-A: clicking this button quits the
> application.
>
> Now, I would like to add a Compact-Data-Before-Quitting function to this
> button. How could I do this?
>
> Of course, I know there is a Compact Data Option in the Tools menu but
> this
> database runs on a network and 3 office colleagues connect to input data
> and
> populate the fields. That is why I would like this Command Button to a)
> compact data and b) quit the application.
>
> Thanks for sharing and assisting.
>
> Sylvie
>
>


Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net