[AccessD] How to Pull Data from an Access Query into Excel with VBA Code in Excel (ADO)

Brad Marks BradM at blackforestltd.com
Sun Nov 25 17:17:27 CST 2012


William,

Good question.

Yes, Query1 returns data when it is run from within Access.

Thanks for your help.

Brad 


-----Original Message-----
From: accessd-bounces at databaseadvisors.com on behalf of William Benson
Sent: Sun 11/25/2012 4:46 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] How to Pull Data from an Access Query into Excel with VBA Code in Excel (ADO)
 
Does query1 return data when run from access?

...grabled by smrat phonn as ususl
On Nov 25, 2012 3:47 PM, "Brad Marks" <BradM at blackforestltd.com> wrote:

> All,
>
> I have just started to experiment with pulling Access 2007 data into Excel.
>
> I have an test Excel file that uses VBA code to pull the data from the
> Access table.
> This is working nicely.
>
> I would now like to pull data into Excel via the Access query that I have
> set up.
>
> I simply changed the SQL Statement in the Excel VBA code like this.
>
> strSQL = "SELECT Field1 From Table1;"
>
> strSQL = "SELECT Field1 From Query1;"
>
> When I now run the Excel VBA code no data is returned.
>
> I must be missing something.
>
> Does anyone have an example of how to pull data from an Access query into
> Excel via VBA code in Excel?
>
> Thanks,
> Brad
>
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>
>
-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.




More information about the AccessD mailing list