View Full Version : Getting criteria from form into pie chart


oihjk
08-26-2003, 12:39 PM
I'm trying to get the criteria for a chart to come from a form. In a form the user can select the report they won't to run and the other parameters. Instead of doing this through a parameter query I won't it to pass via string criteria
(example:

strItems = Me.AFENumber.Value 'Use the value of Me.AFENumber as the criteria

strDocName = Me.cmbPreview.Value 'Open Report named the same as the value in Me.cmbPreview

DoCmd.OpenReport strDocName, acPreview, , strItems )

I can get it to run fine with the report itself, but when I try using this method on the chart it doesn't work. Is it possible to filter a chart this way?

Eric

WayneRyan
08-26-2003, 03:42 PM
Eric,

DoCmd.OpenReport strDocName, acPreview

That will launch the report.

If the form is still open, the report can reference any field on
it by:

Me.MyChartsTextbox = Forms![MyMainForm]![SomeField]

Wayne

oihjk
08-27-2003, 09:47 PM
Thank you for the reply. The problem however isn't with the report, It's with the chart. I'm trying to get the chart to filter in the way that you said above. Maybe you're meaning this and I just missed it. Is this possible? Eric