Append query (VBA)

Y

Yanick

I am trying to append data from a table to a temporary table, which I will use to manipulate data. Here is the code I use:

Dim strSQL As String

strSQL = "INSERT INTO TempTable ( PN ) SELECT [TBL-PN].PN FROM [TBL-PN] _ WHERE ((([TBL-PN].PN) Like 'c6*')) GROUP BY [TBL-PN].PN;"

DoCmd.RunSQL strSQL

The SQL string seems to be OK but I get the error "An action query cannot be used as a row source" when it goes to DoCmd.RunSQL strSQL.

How can I get it to work? Any ideas?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top