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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Delete Records from Table then Append with Autonumber 1

Status
Not open for further replies.

jrmiv

Technical User
May 14, 2007
13
US
I need to delete the records from a table before appending the new results. The table has an autonumber which also needs to be reset. I am currently having to manually delete the records and then compacting and repairing the database to reset the autonumber. Any help would be greatly appreciated.

The Table Name is Document Number and the fields are:
*Document (Autonumber)
*Whse
*Location
*Kit Qty
*Kit
*Kit Desc
*Kit Lot
*Prod Cls
*Minor Cls
 
What about this VBA code ?
DoCmd.SetWarnings False
DoCmd.RunSQL "DELETE * FROM [Document Number]"
DoCmd.RunSQL "ALTER TABLE [Document Number] ALTER COLUMN Document COUNTER(1,1)"
DoCmd.SetWarnings True

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks PHV! This code was great...jrmiv
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top