Run timer error 2451
While using a standard code module I keep getting run time error 2451 that the report I’m trying to open is misspelled or not opened, but I’m trying to open it, ofcourse it’s not opened & I am using the correct name. Before opening it I’m trying to set its record source property as well. Please advise
Function buildSQL()
Dim strSQL As String
strSQL = "SELECT DISTINCTROW SalesCoordinator.SalesCoordinatorName, Director.DirectorName, NewQuery.PromotionType, NewQuery.EventNumber, NewQuery.MediaBuyDetail, NewQuery.DateSentToAccounting, NewQuery.CheckNumber, NewQuery.CheckMailDate, NewQuery.DateSentTo, NewQuery.TotalPaid, NewQuery.DealerNumber, NewQuery.PromotionName FROM Director INNER JOIN (SalesCoordinator INNER JOIN NewQuery ON SalesCoordinator.DirectorCode = NewQuery.RegionalDirectorCode) ON Director.Code = SalesCoordinator.DirectorCode"
DoCmd.OpenReport "rptJunk", acViewPreview, Reports!rptJunk.RecordSource = strSQL
End Function
While using a standard code module I keep getting run time error 2451 that the report I’m trying to open is misspelled or not opened, but I’m trying to open it, ofcourse it’s not opened & I am using the correct name. Before opening it I’m trying to set its record source property as well. Please advise

Function buildSQL()
Dim strSQL As String
strSQL = "SELECT DISTINCTROW SalesCoordinator.SalesCoordinatorName, Director.DirectorName, NewQuery.PromotionType, NewQuery.EventNumber, NewQuery.MediaBuyDetail, NewQuery.DateSentToAccounting, NewQuery.CheckNumber, NewQuery.CheckMailDate, NewQuery.DateSentTo, NewQuery.TotalPaid, NewQuery.DealerNumber, NewQuery.PromotionName FROM Director INNER JOIN (SalesCoordinator INNER JOIN NewQuery ON SalesCoordinator.DirectorCode = NewQuery.RegionalDirectorCode) ON Director.Code = SalesCoordinator.DirectorCode"
DoCmd.OpenReport "rptJunk", acViewPreview, Reports!rptJunk.RecordSource = strSQL
End Function