Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
MS Access
Message
From
29/12/2005 18:04:20
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Other
Title:
MS Access
Miscellaneous
Thread ID:
01081897
Message ID:
01081897
Views:
48
Hello everybody.

This is a question about MS Access.

I have a form which contains objects to allow different selections for a report. in this for i buld a sql string
    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.

does anyone have an idea on how this can be done?

I appreaciate your help!
Next
Reply
Map
View

Click here to load this message in the networking platform