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

William Benson vbacreations at gmail.com
Sun Nov 25 16:46:01 CST 2012


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


More information about the AccessD mailing list