Dim qdef As DAO.QueryDef
Set qdef = CurrentDb.CreateQueryDef("testReportSend", "select Name, ListMissingFrom FROM ListExceptions Where DateProcessed = #6/1/2010#")
DoCmd.SendObject acSendQuery, "testReportSend", acFormatXLS, "[email protected]", , , "query send test", "Please review and resolve", True
CurrentDb.QueryDefs.Delete "testReportSend" |