# Solved: Run an Access Query via Excel VBA



## jo15765 (Oct 11, 2011)

I am wondering how I could run an access query(s) from Excel via VBA? These are update and a make table queries.


----------



## Jimmy the Hand (Jul 28, 2006)

Try this


```
Sub Access_RunQuery()
    Dim aa As Object
    Set aa = CreateObject("Access.Application")
    aa.OpenCurrentDatabase ("D:\Users\Jimmy\Documents\db1.mdb")
    aa.CurrentDb.QueryDefs("Table_make_query").Execute
    aa.Quit
End Sub
```
Jimmy


----------



## jo15765 (Oct 11, 2011)

Works perfectly, Thank you!!!!


----------

