Well rip my knickers and kick my a... Putting the code in the On Format for
the report works, but it doesn't in the On Open. In On Open it says the
properties can't be changed once printing has started!!!! But it works in
the On Format??? I assumed On Format wouldn't work...shouldn't assume.
The values only need to be set once for the report, which is why I chose the
On Open event.
Thanks Bradley. That problem is solved.
Here is another. This same graph is on a form. On the form users enter a
couple of parameters and press a button to process data for the graph. Last
thing before requerying the graph it changes axis min and max values.
The problem is, open the form, enter params and press button to calc and
display query and min max don't change from last time the form was used.
Leave params as are and press button again, running same code again, and it
works, and continues to work there after. Close the form and reopen it and
same problem again.
When the form is opened, the first time doesn't change the setting. I have
stepped through code and it sets the values but the graph min max doesn't
change, other then displaying the data correctly.
Jeff
"Bradley" <br*****@REMOVETHIScomcen.com.au> wrote in message
news:_p******************@news-server.bigpond.net.au...
Jeff wrote: Hi
I have a report with a graph on it and want to change the minimum and
maximum values for the value axis when it is previewed. This can't be
done by adding code in the Open event as once the report has started
printing the properties can't be changed.
Why not use a Form instead?
It can be done with an MDB by opening it in design mode hidden,
making the change, saving it and then opening it in preview mode.
However, this obviously doesn't work in an MDE which is how this is
distributed.
If I leave it on Auto the graph does not always set the minimum and
maximum to sensible values, and sometimes the 4 series are all
bunched together and unreadable.
Make sure all your settings are correct....
Does any one have any ideas?
Jeff
You can set the value in code on the OnFormat property I think. You
would need to reference the MSGraph object if you want to use the Graph
object in code.
I've done a lot with MSGraph via code so if you need more info I'll try
and dig up an example.
ps. Another suggestion: I store the graph object in a table and display
it on a report that way
--
regards,
Bradley