How can I change a report or chart RowSource SQL at run-time (dynamically)?
If you have a report based on form parameters, and/or one that uses the TOP clause, then you can set the RowSource property SQL in the Report_Open event. See Access FAQ 24 How do I select the top/bottom rows of a query dynaset?, the extra bit added April 2010. Me.RecordSource = strSQL ‘where strSQL = a string variable in which you have set up the required SQL However, setting the SQL in the RowSource property for a chart isn’t as simple. I tried using various events to set this property, but without any luck.