I'm trying to open a report and change the record source with VBA putting in SQL as it's source. It keeps sending me to the debugger. This is what I put in it:
DoCmd.OpenReport "rptEquipmentInv", acViewPreview, "", "", acNormal
Reports!rptEquipmentInv.Report.RecordSource = "SELECT [EquipID], [UTIDNumber], [SerialNumber], [EquipDesc], [EquipCost], [CurrentLoc] FROM qryEquipmentInv WHERE EquipTypeID <> 22 and EquipTypeID <> 23 and EquipTypeID <> 24 and CategoryID <> 2 and DeptOwned ORDER BY [UTIDNumber]; "