PC Review


Reply
Thread Tools Rate Thread

Append query (VBA)

 
 
=?Utf-8?B?WWFuaWNr?=
Guest
Posts: n/a
 
      28th Jun 2004
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?



 
Reply With Quote
 
 
 
 
=?Utf-8?B?WWFuaWNr?=
Guest
Posts: n/a
 
      28th Jun 2004
I finally figured out my-self.

Thank you!

"Yanick" wrote:

> 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?
>
>
>

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Append query - Append to table with Autonumber field Boon Microsoft Access Queries 2 29th Jun 2009 06:23 PM
Append query to append lots of record with range input domibud Microsoft Access Queries 7 9th May 2008 02:26 AM
Append Query in VBA - to append VBA variable values to Access tabl =?Utf-8?B?QWdlbnQgRGFnbmFtaXQ=?= Microsoft Access VBA Modules 4 1st Nov 2006 04:25 PM
Link CSV file created query append query to append data =?Utf-8?B?ZXNwYXJ6YW9uZQ==?= Microsoft Access Queries 2 5th Jul 2005 04:49 PM
Append Query... Can't Create a Unique Number to Append Vance Microsoft Access Queries 8 17th Dec 2003 11:18 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:57 PM.