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