howdy,
I've got a report called rptSummary[color] with two OLE pie charts on it. I'm opening the report from a form called frmAdminTools. I've got some code on the report's On Open event that grabs some parameters from frmAdminTools and makes a query string. I'm trying to apply the query to the Row Source for the OLE pie charts within the same report On Open event. I'm getting errors to the effect of "You entered an expression that has an invalid reference to the property form/report."
How do I set the query string that I've created as the data source for my OLE pie charts? I've included a sample of the code I'm trying to use to pass the query to the OLE object. Yes - my query works.
I've got a report called rptSummary[color] with two OLE pie charts on it. I'm opening the report from a form called frmAdminTools. I've got some code on the report's On Open event that grabs some parameters from frmAdminTools and makes a query string. I'm trying to apply the query to the Row Source for the OLE pie charts within the same report On Open event. I'm getting errors to the effect of "You entered an expression that has an invalid reference to the property form/report."
How do I set the query string that I've created as the data source for my OLE pie charts? I've included a sample of the code I'm trying to use to pass the query to the OLE object. Yes - my query works.
Code:
Me.OLEUnbound42.Report.RecordSource = "SELECT tblIncidentLocation.Location, Count(*) AS [Count] " & _ "FROM tblIncidents INNER JOIN tblIncidentLocation " & _ "ON tblIncidents.Location = tblIncidentLocation.ID WHERE " & strWhere & " GROUP BY " & _ "tblIncidentLocation.Location;"