Append query via VBA

  • Thread starter Thread starter Kent
  • Start date Start date
K

Kent

Hi

I need to add all data from a temp table into another table by using VBA.
Which is the easiest way to do this?
 
StrSQL = "INSERT INTO [YourTargetTable] (Field1, field2, field3)" & _
" SELECT FieldA, FieldB, FieldC FROM [YourSourceTable] "

Currentdb().Execute StrSQL,DbFailonError

Enter Insert Into in the Help Search and then select the Insert Into statement
item.

John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
 
Or alternatively - if you're not comfortable with SQL... Build a standard
query then call it using the same method

Currentdb.execute "QueryNameHere"

================================
 
Back
Top