Run timer error 2451

arage

Registered User.
Local time
Today, 07:55
Joined
Dec 30, 2000
Messages
537
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 :D

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
 
How about:

DoCmd.OpenReport "rptJunk", acViewPreview, strsql

HTH
John
 
Hehe…yeah that worked John thanks but as I modified my strSql string now to be much shorter & equal a field I’d like to filter on, I’m just having problems getting that to work now, but thanks anyway! :D
 

Users who are viewing this thread

Back
Top Bottom