create query as sql access vba

Solutions on MaxInterview for create query as sql access vba by the best coders in the world

showing results for - "create query as sql access vba"
Leuan
30 Jun 2020
1Sub CreateQuery()
2 
3    Dim db      As DAO.Database
4    Dim qDef    As DAO.QueryDef
5 
6    Set db = CurrentDb
7    Set qDef = db.CreateQueryDef("MyQuery")
8    qDef.SQL = "SELECT * FROM Vitoshacademy"
9    qDef.Close
10    db.Close
11    Set qDef = Nothing
12    Set db = Nothing
13    Application.RefreshDatabaseWindow
14 
15End Sub
16