Append Query ? Again

  • Thread starter Thread starter Jason Rhymes
  • Start date Start date
J

Jason Rhymes

Is there a way for an append query to ask which table to use to append from?
I have a dialog box w/ a combo box already that list all the tables in the
database if that helps.
 
Jason said:
Is there a way for an append query to ask which table to use to append from?
I have a dialog box w/ a combo box already that list all the tables in the
database if that helps.
I guess you would need to use code (programming) to write the SQL (query) and either run the SQL-text (using a recordset object) or write the SQL to q query object and then run that one.

In the following example 'QueryName' is the name of an existing query object (which will be changed each time the code is run), strTableName is the name of the table you want to append from.


With CurrentDb().QueryDefs("QueryName")
.SQL = "INSERT INTO MyTable SECECT (columns, ...) FROM " & strTableName & " WHERE ..."
.Close
End With

Hth
PerL
 
That's a little over my head. I tried to get it to work but couldn't. Thanks
for the response though.
 
Back
Top