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

Jim Dettman jimdettman at verizon.net
Sun Nov 25 17:31:20 CST 2012


Take the SQL from query1 in access and use it on the excel side in the ado call

Jim

Sent from my iPhone

On Nov 25, 2012, at 3:39 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



More information about the AccessD mailing list