PC Review


Reply
Thread Tools Rating: Thread Rating: 2 votes, 1.00 average.

Compact & Repair, Open table, close table, then run macro

 
 
Duncs
Guest
Posts: n/a
 
      23rd Feb 2011
I have an Autoexec macro in a dadabase that runs a delete query and
imports some data. It then executes an append query before opening a
table.

What I want to do in the Autoexec is:

Run delete query
Compact and Repair database
Import data
Run append query
Open table
Run other macros

However, I get an error with the compact & Repair...I can't run it
from VBA or a macro, or something like that. Also, wouold the 'Run
other macros' wait until the table was closed, or would they continnue
regardless?

Duncs
 
Reply With Quote
 
 
 
 
David-W-Fenton
Guest
Posts: n/a
 
      23rd Feb 2011
Duncs <(E-Mail Removed)> wrote in
news:1083d2aa-7eea-4fae-9c81-(E-Mail Removed)
:

> What I want to do in the Autoexec is:
>
> Run delete query
> Compact and Repair database
> Import data
> Run append query
> Open table
> Run other macros
>
> However, I get an error with the compact & Repair...I can't run it
> from VBA or a macro, or something like that. Also, wouold the
> 'Run other macros' wait until the table was closed, or would they
> continnue regardless?


Perhaps this will help:

http://trigeminal.com/lang/1033/utility.asp?ItemID=8#8

--
David W. Fenton http://www.dfenton.com/
contact via website only http://www.dfenton.com/DFA/
 
Reply With Quote
 
Duncs
Guest
Posts: n/a
 
      24th Feb 2011
On Feb 23, 8:51*pm, "David-W-Fenton" <NoEm...@SeeSignature.invalid>
wrote:
> Duncs <true.kilted.s...@gmail.com> wrote innews:1083d2aa-7eea-4fae-9c81-(E-Mail Removed)
> :
>
> > What I want to do in the Autoexec is:

>
> > Run delete query
> > Compact and Repair database
> > Import data
> > Run append query
> > Open table
> > Run other macros

>
> > However, I get an error with the compact & Repair...I can't run it
> > from VBA or a macro, or something like that. *Also, wouold the
> > 'Run other macros' wait until the table was closed, or would they
> > continnue regardless?

>
> Perhaps this will help:
>
> http://trigeminal.com/lang/1033/utility.asp?ItemID=8#8
>
> --
> David W. Fenton * * * * * * * * *http://www.dfenton.com/
> contact via website only * *http://www.dfenton.com/DFA/


David,

Looks like a good idea but, the problme is I'd need to install
the .DLL on every PC that the database will run on. Also, it doens't
answer the question of whether I can suspend macro execution until the
table is closed.

Duncs
 
Reply With Quote
 
David-W-Fenton
Guest
Posts: n/a
 
      25th Feb 2011
Duncs <(E-Mail Removed)> wrote in
news:636d0015-7ca8-488d-b79b-(E-Mail Removed)
m:

> Looks like a good idea but, the problme is I'd need to install
> the .DLL on every PC that the database will run on. Also, it
> doens't answer the question of whether I can suspend macro
> execution until the table is closed.


Well, the fact is, you can't compact a database that is open in the
UI. Indeed, there is almost no case where that is required, as users
should only ever open the front end, and front ends don't need to be
compacted (unless they are badly designed).

--
David W. Fenton http://www.dfenton.com/
contact via website only http://www.dfenton.com/DFA/
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Corrupt Table & compact/repair not working =?Utf-8?B?RGF2aWQgTXVlbGxlcg==?= Microsoft Access Getting Started 4 1st Jun 2007 01:11 PM
Open Access, Paste data to table, and close all from Excel Macro =?Utf-8?B?bGVhcm5pbmdhY2Nlc3M=?= Microsoft Excel Programming 2 26th Apr 2007 04:04 PM
Clean up a table or mdb beyond compact and repair? Laurel Microsoft Access Database Table Design 2 21st Sep 2006 01:34 PM
Can't Compact&Repair - corrupt table (help!) =?Utf-8?B?QW5keSBDIE1hdHRoZXdz?= Microsoft Access 2 21st Jul 2006 07:09 PM
Re: Compact/Repair and Deleting Table Entries Cheryl Fischer Microsoft Access 0 7th May 2004 05:39 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:02 AM.