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!

Transferring the contents of a table

Status
Not open for further replies.

MattBeas

Programmer
Nov 15, 2001
17
GB
Hi!
I Need some help!!

I have 2 tables. a ProductsTbl and a TempTbl

On entry into a form I need to copy the contents of the ProductsTbl to the TempTbl.

Does any know how to copy the contents of one table to another. The tables have exactly the same structure.

Any solutions would be greatly appreciated!
Thanks!
 
Use a simple append query. You can do it in SQL:

DoCmd RunSQL "INSERT INTO TempTbl SELECT ProductTbl.* FROM ProductTbl;"

or you can use the query designer to create an append query and then call it from code:

DoCmd.OpenQuery "CopyToTemp"

Placing the above code in the On Open event of your form should do it.

Uncle Jack
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top