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

Loop thru tables and use SELECT INTO 1

Status
Not open for further replies.

evalesthy

Programmer
Oct 27, 2000
513
US
I would like to loop thru a group of tables and copy each one using SELECT INTO. How would I replace table name with a string? For example in: db.Execute "SELECT Employees.* INTO [Emp Backup] FROM Employees;" how would Employees and Emp Backup be replaced with strTbl and strNewTbl - I can't seem to get the syntax right.
 
Try
db.Execute "SELECT [" & strTbl & "].* INTO [" & strNewTbl & "] FROM Employees;"

Ben ----------------------------------
Ben O'Hara
bo104@westyorkshire.police.uk
----------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top