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

Copy Entire Table to another Table 1

Status
Not open for further replies.

jheiser

Programmer
Dec 19, 2003
14
US
I need to copy the entire contents of a table called shippingreport into a table called saveshiptable when i click a command button on my form, but I can only copy one record. After the copy is complete I need to delete all of the records in the shippingreport table.

 
If you just need a one time copy, you can copy and paste with a new name. This will create an exact duplicate of your table with a new name. To delete all records in a table is a simple
DELETE *
FROM Tablename;

Ken

- If you are flammable and have legs, you are never blocking a fire exit.
Mitch Hedburg
 
Something like this ?
DoCmd.RunSQL "INSERT INTO saveshiptable SELECT * FROM shippingreport;"
DoCmd.RunSQL "DELETE FROM shippingreport;"

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top