If strWhereClause = "" Then strWhereClause = " WHERE " Else strWhereClause = strWhereClause & " AND " End If strWhereClause = strWhereClause & "((([tblBuilderLotInfo].[strSubdivision])=str_Sel_Subdivision))" stSql = "SELECT [tblSubdivisionInfo].[strSubdivision], ..." stSql = stSql & " FROM tblBuilder INNER JOIN (tblSubdivisionInfo INNER JOIN tblBuilderLotInfo ON [tblSubdivisionInfo].[strSubdivision]=[tblBuilderLotInfo].[strSubdivision]) ON [tblBuilder].[strCompanyName]=[tblBuilderLotInfo].[strBuilder]" stSql = stSql & strWhereClause & ";"then i call the report like this:
stDocName = "rptBuilderMarketYTD_Range"
DoCmd.OpenReport stDocName, acPreview
i would like to set the 'recordSource' property of the report to the stSql macro, so the when the code changes the sql, then next time the report is called it will process the different querry. i have tried different syntaxes and can not get it right. I.E.:[FORMS]![frm_ReportParameter_Dte_Builder_Sub_Range]![stSql]i was also thinking about setting the report.recordsource property at run time, but didn't get anywhere on this end either.