Wow, lots of great replies and a few clinkers
I guess my question should be is there VBA that could list my tables and
what each size is? I wish they had the option to show table size in the
properties of each table. Not unlike checking file size on a file on your
desktop (right click/properties)
It would be nice to find the 'worst offenders' and be able to delete them.
Well... it's not that simple.
A Table isn't really all that analogous to a disk file. Your table
will store your data; but there are indexes which take a variable
amount of space (and it's not at all easy to determine how much),
system overhead, lost blocks, uncleaned deleted data (even if you
compact). Even the data itself is tricky to size, since Text fields
are stored without trailing blanks - e.g. a 255 byte Text field might
actually take up only 11 bytes on disk in one record, and 259 (255 in
contents, 4 in overhead) in another. IME the "size of the table" is
simply not a very useful number; if you really need to know, you can
compact the database; note its size; delete the table; compact again;
and compare sizes. Be aware that Access allocates disk in 32KByte
chunks so you won't be able to get the size to any finer resolution
than this!
If you're routinely importing files, you might want to consider having
TWO .mdb files - one for the "real data", and the other for temporary
import files. You can link to both backends from a shared frontend (a
split architecture is a *very* good idea in any case), and run your
append queries from the scratch backend into the production one.
Regular compaction is essential in any case.
John W. Vinson[MVP]