472,989 Members | 3,144 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,989 software developers and data experts.

Changing graph axis min max on report

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.

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.

Does any one have any ideas?

Jeff
Nov 12 '05 #1
3 4519
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
Nov 12 '05 #2
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

Nov 12 '05 #3
Jeff wrote:
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.
Good idea :) If you think about it it does make sense though.
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.
Great, that was simple enough:)
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
I'm just trying to think of some "tricks" I had to do when I was working
with Graph....

(1) Before changing any properties try moving the focus to the Graph
object (even try moving focus back afterwards?)

eg. Code that update the data behind my graph

Me.Refresh
ExtractChart Me![ChartID], False 'function that gets data
Me.Refresh
Me![MyGraph].SetFocus
SetDatasheet Me![MyGraph], Me![ChartID], True 'function that put
data on datasheet
Me![MyGraph].SetFocus 'seems to be needed to force chart to refresh

(2) Don't assign values from a form to a graph property directly, assign
to a variable first

(3) Another oddity, "MyGraph.Datasheet.Cells.ClearContents" doesn't work
properly in A97 but does in A2000 (it clears the contents but does not
reset the chart's range). In A97 I had to delete the cells in the
datasheet but that cleared all my series settings.

Hope that helps.

Bradley

"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


--
regards,

Bradley
Nov 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Jeff | last post by:
Hi I am manipulating MS Graph and can successfully change the minimum and maximum values for the Y axis, but can't find a way of doing this for the X axis. This works for Y axis...
2
by: borekfm | last post by:
Hitting two problems when running a new report I've created, that contains a chart/graph. The chart shows three series, two are shown as lines and one as an area. The data come from three different...
2
by: savas_karaduman | last post by:
I supposed that creating graph with access would be as easy as how I could with Excel. But it seems to me that there is some tricky point here. What i am trying to do and what i got is as follow: ...
2
by: smith.mariya | last post by:
hi, i am mariya. i am working on vb.net. i have created the powerpoint addin. i have inserted the chart on the slide through vb.net code. now, i want to remove the gridlines on the chart and want...
3
by: ConfusedMay | last post by:
Hi, I need to create a graph report that showed total hours and unattended hours based on certain months and operation code that user input into the form. I have two queries: one to calculate...
2
by: Sirrev | last post by:
MS Access 97 WinXP I've created a report bar graph and each bar represents the data from a different BU(Business Unit). The report bar graph works as it should except for the following :...
0
by: Just_a_fan | last post by:
Some folks have searched, from time to time, for a dual axis MSChart with different scales on the two Y axes. The sample, extracted from running code I wrote, produces a graph with MSChart (VB9)...
0
by: eureka2050 | last post by:
Hi all, I am creating a radar chart containing 2 plots using jpgraph. My code is as follows:- include ("./jpgraph/src/jpgraph.php"); include ("./jpgraph/src/jpgraph_radar.php"); //...
2
by: thanawala27 | last post by:
Hello Friends, I'm new to VB.net, but have been programming from a long time in other languages. I wanted to plot a graph for one of my application in VB.net. I want a Time (X-axis) Vs...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.