<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Compact DB</TITLE>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1170" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=615552214-02052003><FONT face=Arial color=#0000ff size=2>It
depends. A2k and > has it on the Tools menu. For A97 use
this:</FONT></SPAN></DIV>
<DIV><SPAN class=615552214-02052003></SPAN><FONT face=Tahoma><FONT size=2><SPAN
class=615552214-02052003><FONT
face=Arial></FONT></SPAN></FONT></FONT> </DIV>
<DIV><FONT face=Tahoma><FONT size=2><SPAN class=615552214-02052003><FONT
face=Arial>Public Sub SelfCompact()<BR> '
Comments : A massive work around to the lack of compact on close in
A97.<BR>
'
Builds a temporary Command Bar and then closes and reopens the
DB.<BR>
'
Code credit to Jim Dettman. Online Computer Services of WNY, Inc. <A
href="mailto:jimdettman@earthlink.net">jimdettman@earthlink.net</A><BR>
' Parameters : -<BR> '
Returns : -</FONT></SPAN></FONT></FONT></DIV><FONT
face=Tahoma><FONT size=2><SPAN class=615552214-02052003><FONT face=Arial>
<DIV><BR> On Error GoTo PROC_ERR<BR></DIV>
<DIV> With CommandBars.Add(, 1, ,
True)<BR> .Controls.Add 1, 2071,
, , True<BR> .Visible =
True<BR>
.Controls(1).SetFocus<BR>
DoEvents<BR> SendKeys
"~"<BR> End With<BR>
Exit Sub<BR>
<BR>PROC_ERR:<BR> MsgBox "The following error
occurred: " & Error$<BR> Resume Next<BR>End
Sub<BR></FONT> </SPAN></FONT></FONT></DIV>
<DIV><FONT face=Tahoma><FONT size=2><SPAN
class=615552214-02052003>HTH</SPAN></FONT></FONT></DIV>
<DIV><FONT face=Tahoma><FONT size=2><SPAN
class=615552214-02052003>JB</SPAN></FONT></FONT></DIV>
<DIV><FONT face=Tahoma><FONT size=2><SPAN
class=615552214-02052003></SPAN></FONT></FONT> </DIV>
<DIV><FONT face=Tahoma><FONT size=2>-----Original Message-----<BR><B>From:</B>
accessd-bounces@databaseadvisors.com
[mailto:accessd-bounces@databaseadvisors.com]<B>On Behalf Of </B>Smethurst,
Ryan<BR><B>Sent:</B> Friday, May 02, 2003 5:16 AM<BR><B>To:</B>
'accessd@databaseadvisors.com'<BR><B>Subject:</B> [AccessD] Compact
DB<BR><BR></DIV></FONT></FONT>
<BLOCKQUOTE dir=ltr
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
<P><B><I><FONT size=2>---- London Borough of Bromley E-Mail Disclaimer
----</FONT></I></B><I></I> <BR><FONT size=2>"For information about Bromley
Council visit our web site www.bromley.gov.uk"</FONT> </P>
<P><FONT size=2>"The information contained in this message (including any
attachments) is confidential in that it is intended solely for the use of the
recipient to which it is addressed. If you are not the intended recipient, the
use of the information by disclosure, copying or distribution is prohibited
and may be unlawful." </FONT></P>
<P><B><I><FONT size=2>---- End of Disclaimer ---- </FONT></I></B></P>
<P><FONT size=2>Hi Group,</FONT> </P>
<P><FONT size=2>Is it possible to compact a db in code when quitting
it?</FONT> </P>
<P><FONT size=2>Thanks</FONT> <BR><FONT size=2>RyanS</FONT>
</P></BLOCKQUOTE></BODY></HTML>