I've never seen a single statement that would completely clear an existing table in preparation for a fresh loading. What's the simplest way to accomplish such a procedure? Delete the table and then TableDef a new one?
I've never seen a single statement that would completely clear an existing table in preparation for a fresh loading. What's the simplest way to accomplish such a procedure? Delete the table and then TableDef a new one?
currentdb.execute "Delete * from tablename" will accomplish that for you.
sometimes if you have lots of records the delete will take awhile. I have been using something like this:
DoCmd.TransferDatabase acExport, "Microsoft Access", CurrentDb().Name, acTable, "TableToCopy", "TableToCreate", False 'this will create a new empty table- I use the suffix "_EMPTY" for the tabletocreate
Then you DoCmd.DeleteObject acTable, "TableToCopy"
Finally DoCmd.Rename "TableToCopy", acTable, "TableToCreate"
Cheers,
Vlad
Very small amount of records so delete will go plenty fast enough.
Thanks,
Bill