delete table contents

bauer

Registered User.
Local time
Today, 09:52
Joined
Aug 23, 2001
Messages
77
I am trying to figure out how to delete all of a tables contents without haveing to delete each record individually.

My other option is to use a transferText but overwrite the table contents.

Thank you all,

Eric
 
bauer, use a delete query. Make a new query with the table you intend to delete and then select View > SQL View then choose Query > Delete Query to set the criteria or leave blank for all records.

If you would like to turn off the warnings for deleting the data you could use DoCmd.SetWarnings False just make sure to set them back to true when you are done running the query.
 
One thing, how do I run the query from code?
 
Never mind, I got it. However, I now I have another problem.
I am trying to import a csv file into a table. I first want to transfer the old data into a new table, and then delete the table contents, and then import the csv file into the old empty table. There's one catch, the csv file has no headres, so I get an error:
2391: Field 'F1' doesn't exist in destination table 'table1'

Thank you,
Eric
 

Users who are viewing this thread

Back
Top Bottom