If you're using Access 2K or newer to compact the current database, use this
code:
http://www.mvps.org/access/general/gen0041.htm
If you're using Access 97, you can't compact the current database via code,
but there are alternatives. See this page:
http://www.mvps.org/access/modules/mdl0030.htm
If you're using Access 2007, I don't have a canned answer for that one yet.
Chris
Microsoft MVP
aconti74@gmail.com wrote:
Quote:
>Hello I am new to vba programming/coding. I am writing a program that
>goes through a directory of text files and imports them into the
>database. The problem is eventually the database gets to big and
>needs to be compacted. I know how to compact on exit but how do you
>do it in a loop using vba? My old program in basic did it because it
>was external to access. Any ideas?
>
>1.import text file
>2.loop - check size
2a. compact database if need and continue importing text files.
2b. continue importing text file
--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200807/1