Creating query from SQL string

  • Thread starter Thread starter stevecrowhurst
  • Start date Start date
S

stevecrowhurst

Can anyone tell how I write the code to create a qry from
an SQL string that is currently in a MsgBox
 
Dim db As DAO.Database
Dim qdf As DAO.QueryDef

Set db = CurrentDb()
Set qdf = db.CreateQueryDef("SomeName4TheQuery")
qdf.SQL = "SELECT BookingID, BookingDate FROM tblDaoBooking;"

Set qdf = Nothing
Set db = Nothing
 
Back
Top