parameterised pivotchart problem

  • Thread starter Thread starter bobby
  • Start date Start date
B

bobby

Here one for the pivotchart expert:

Situation: I have a pivotchart on a form that can only show in pivotchart
view. The forms recordsource is a stored procedure. The form is placed on a
report, so users can print it easily. It all works fine.

The problem: It is a dynamic pivotchart in that the stored procedure is
parameterized. I send the parameters to the report in the OpenArgs argument
of DoCmd.OpenReport statement. Here is where the InputParameters property
comes into the picture. You would think that is exactly what it is
therefore, and for "normal" forms it works a charm. But when it comes to
pivotcharts the user will get prompted to enter the parameter values no
matter how I try to set the parameters. It is as if the stored procedure is
run before the form opens, so it doesn't give me a change to set the
parameters.

If I dynamically set the recordsource of the form, the setup of the
pivotchart is reset. I will then have to dynamically have to create the
whole pivotchart in code which I would rather avoid.

Does someone have experience with this?
 
Hello bobby:
You wrote on Fri, 22 Oct 2004 10:21:39 +0100:

b> The problem: It is a dynamic pivotchart in that the stored procedure is
b> parameterized. I send the parameters to the report in the OpenArgs
b> argument of DoCmd.OpenReport statement. Here is where the
b> InputParameters property comes into the picture.

I don't quite understand; OpenArgs and InputParameters are different
properties; you can send OpenArgs in DOCMD.OPENFORM, but you can't send
InputParameters. Do you mean, if you send OpenArgs, they somehow
automatically become InputParameters?

b> You would think that is exactly what it is therefore, and for "normal"
b> forms it works a charm. But when it comes to pivotcharts the user will
b> get prompted to enter the parameter values no matter how I try to set
b> the parameters. It is as if the stored procedure is run before the form
b> opens, so it doesn't give me a change to set the parameters.

If your pivotchart form is being opened from form1, then you can set
InputParameters to refer a public variable or control in form1, and have the
variable set before openform.

Vadim
 
Back
Top