I like to use an unbound subform to display the result of an crosstab query. However following code
Me.subFormForecastSummary.Form.RecordSource = "SELECT ....."
results in this error message: "The expression you entered refers to an object that is closed or doesn't exist".
When I use the Source Object in the form designer and specify the select statement, then the code above works fine and I am able to set the property RecordSource.
The issue I am facing is that the select statement is based on a crosstab query and can contain a different number of columns (in my case weeks) depending on the master record. The issue I am facing is that the datasheet only displays the columns as per the original query specified in SourceObject (the data itself is refreshed though). Does anyone know how I can force the columns to be refreshed as well or how I can get overcome the error message?
Thanks