Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

change scale in graph based on query 1

Status
Not open for further replies.

microtoolmaker

Technical User
Feb 21, 2000
17
US
I need scale on y axis to change based on query results, so that;<br><br>minimum on y scale =lowest y value-1 <br>and<br>maximum on y scale = highest y value +1<br><br>Is there any way to do this?
 
You can set the Scale Maximum and Minimum to Auto from the design view (format axis) of your graph, thus the Max and Min will float with the query.<br><br>Maybe this will help,<br>RDH <p>Ricky Hicks<br><a href=mailto: rdhicks@mindspring.com> rdhicks@mindspring.com</a><br><a href= > </a><br>
 
When choosing the &quot;auto&quot; option access makes the minimum y scale to zero.&nbsp;&nbsp;This wide scale hides the details.&nbsp;&nbsp;Is there a programmatic fix for this?
 
Here is some code that I copied from a sample database that might give you some help. This was used to change the Min and Max values in by clicking a button. There are several good graph examples in this sample db. If you would like a copy of it, email me your email address and I will send it to you.<br><br>Private Sub btnUpdChart_Click()<br><br>On Error Resume Next<br>'-------------------------------------------------------------------<br>'This procedure sets the properties of the axes object to the values<br>'typed in the text boxes on the form. For instance, it uses the<br>'minimumscale text box to fill the minimumscale property of the axes<br>'object and so on. If text box has a null, it does not use it and thus<br>'avoids an error.<br>'-------------------------------------------------------------------<br><br>Me![graphorders].Object.Application.Chart.axes(2).minimumscale = _<br>&nbsp;&nbsp;&nbsp;&nbsp;CDbl(Me![minscale]) 'Set the minimum scale<br>Me![graphorders].Object.Application.Chart.axes(2).maximumscale = _<br>&nbsp;&nbsp;&nbsp;&nbsp;CDbl(Me![maxscale]) 'Set the maximum scale<br>Me![graphorders].Object.Application.Chart.axes(2).minorunit = _<br>&nbsp;&nbsp;&nbsp;&nbsp;CDbl(Me![minorunit]) 'Set the minor unit<br>Me![graphorders].Object.Application.Chart.axes(2).majorunit = _<br>&nbsp;&nbsp;&nbsp;&nbsp;CDbl(Me![majorunit]) 'Set the major unit<br><br>End Sub<br><br>Good Luck,<br>RDH <p>Ricky Hicks<br><a href=mailto: rdhicks@mindspring.com> rdhicks@mindspring.com</a><br><a href= > </a><br>
 
Thanks...This looks like the right direction.&nbsp;&nbsp;I'll give it a try. I sent my email address...would like to look through the sample database.&nbsp;&nbsp;I think it will help me ubderstand how to implement the code. Thanks very much.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top