Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

delete all records

Status
Not open for further replies.

ejmiller2

Programmer
Jun 3, 2003
38
US
i want to populate a table with info from a txt file...but first i want to make sure this table is blank...nothing there...i must do this before populating...i tried this...

Do Until rsPeopleNotEmailed.BOF

rsPeopleNotEmailed.MoveLast
rsPeopleNotEmailed.Delete
Loop

but it give me the eof bof error...any suggustions?..thanks

eric
 
use

DoCmd.SetWarnings False
DoCmd.RunSql("Delete * From TableName")
DoCmd.SetWarnings True

PaulF

 
Try doing this. This is a basic SQL delet command that will delete records from a table based on criteria you set. In the below example, I am deleting all of the records from my table RptTrk_Archive, which I use as a temporary holding pen for records before archiving them. The FALSE tells Access you do not want this action to be part of a transaction, which is a function to "undo" changes.

DoCmd.RunSQL "DELETE RptTrk_Archive.* FROM RptTrk_Archive", False
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top