Graphs Y Axis

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to put the maximum number on the Y Axis automatically instead of
entering the maximum number. My numbers will change over time as more data
is added. I noticed the following code to add from another question from
someone.

Me![OLEUnbound0].Axes(2).maximumscale = Me![MaxScale]

However, I am not certain where to put this code. I added the reference
library but still get an error. Would I place the code on the open event to
the graph?

Thanks in advance for any assistance you can provide.
 
Miskacee,

I think that the error is caused due the fact you have reference your axes
incorrectly. If you use a chart with only 1 y-axe (1) and x-axe (0) the code
should be something like this
Me![OLEUnbound0].Axes(1).maximumscale = Me![MaxScale]
 
I get an error saying, "cannot find the field max scale referred to in my
expression." This is the same error I got whenever I originally typed in the
original information. Do you have any suggestions?

Brotha Lee said:
Miskacee,

I think that the error is caused due the fact you have reference your axes
incorrectly. If you use a chart with only 1 y-axe (1) and x-axe (0) the code
should be something like this
Me![OLEUnbound0].Axes(1).maximumscale = Me![MaxScale]


Miskacee said:
I am trying to put the maximum number on the Y Axis automatically instead of
entering the maximum number. My numbers will change over time as more data
is added. I noticed the following code to add from another question from
someone.

Me![OLEUnbound0].Axes(2).maximumscale = Me![MaxScale]

However, I am not certain where to put this code. I added the reference
library but still get an error. Would I place the code on the open event to
the graph?

Thanks in advance for any assistance you can provide.
 
I think you have used an MS Graph instead of OWC?

The following should work:
With Me.myGraph.Axes(xlValue)
.MinorUnit = 2
.MajorUnit = 4
End With

Miskacee said:
I get an error saying, "cannot find the field max scale referred to in my
expression." This is the same error I got whenever I originally typed in the
original information. Do you have any suggestions?

Brotha Lee said:
Miskacee,

I think that the error is caused due the fact you have reference your axes
incorrectly. If you use a chart with only 1 y-axe (1) and x-axe (0) the code
should be something like this
Me![OLEUnbound0].Axes(1).maximumscale = Me![MaxScale]


Miskacee said:
I am trying to put the maximum number on the Y Axis automatically instead of
entering the maximum number. My numbers will change over time as more data
is added. I noticed the following code to add from another question from
someone.

Me![OLEUnbound0].Axes(2).maximumscale = Me![MaxScale]

However, I am not certain where to put this code. I added the reference
library but still get an error. Would I place the code on the open event to
the graph?

Thanks in advance for any assistance you can provide.
 
I know I sound like an idiot but will ask anyway, OWC - Office Web
Components? I'm not certain what I used, I just created the chart in Access.
Not certain what minorunit/majorunit being at 2 and 4 means. I don't want
to have a max unit and whenever I remove the number from the section I get an
error. I want the graphs to put the proper number on the Y axis, based upon
the data. Hope that makes sense. If I am to use OWC, how do I get that? I
added the proper reference I believe.

Thanks!

Brotha Lee said:
I think you have used an MS Graph instead of OWC?

The following should work:
With Me.myGraph.Axes(xlValue)
.MinorUnit = 2
.MajorUnit = 4
End With

Miskacee said:
I get an error saying, "cannot find the field max scale referred to in my
expression." This is the same error I got whenever I originally typed in the
original information. Do you have any suggestions?

Brotha Lee said:
Miskacee,

I think that the error is caused due the fact you have reference your axes
incorrectly. If you use a chart with only 1 y-axe (1) and x-axe (0) the code
should be something like this
Me![OLEUnbound0].Axes(1).maximumscale = Me![MaxScale]


:

I am trying to put the maximum number on the Y Axis automatically instead of
entering the maximum number. My numbers will change over time as more data
is added. I noticed the following code to add from another question from
someone.

Me![OLEUnbound0].Axes(2).maximumscale = Me![MaxScale]

However, I am not certain where to put this code. I added the reference
library but still get an error. Would I place the code on the open event to
the graph?

Thanks in advance for any assistance you can provide.
 
Try the following that should work
with me.OLEUnbound0
.MaximumScale = Me![MaxScale]
end with

Regarding OWC charting there is lot to find on the web. Try google and you
will find lots of information and examples.

Miskacee said:
I know I sound like an idiot but will ask anyway, OWC - Office Web
Components? I'm not certain what I used, I just created the chart in Access.
Not certain what minorunit/majorunit being at 2 and 4 means. I don't want
to have a max unit and whenever I remove the number from the section I get an
error. I want the graphs to put the proper number on the Y axis, based upon
the data. Hope that makes sense. If I am to use OWC, how do I get that? I
added the proper reference I believe.

Thanks!

Brotha Lee said:
I think you have used an MS Graph instead of OWC?

The following should work:
With Me.myGraph.Axes(xlValue)
.MinorUnit = 2
.MajorUnit = 4
End With

Miskacee said:
I get an error saying, "cannot find the field max scale referred to in my
expression." This is the same error I got whenever I originally typed in the
original information. Do you have any suggestions?

:

Miskacee,

I think that the error is caused due the fact you have reference your axes
incorrectly. If you use a chart with only 1 y-axe (1) and x-axe (0) the code
should be something like this
Me![OLEUnbound0].Axes(1).maximumscale = Me![MaxScale]


:

I am trying to put the maximum number on the Y Axis automatically instead of
entering the maximum number. My numbers will change over time as more data
is added. I noticed the following code to add from another question from
someone.

Me![OLEUnbound0].Axes(2).maximumscale = Me![MaxScale]

However, I am not certain where to put this code. I added the reference
library but still get an error. Would I place the code on the open event to
the graph?

Thanks in advance for any assistance you can provide.
 
Thank you. I will try this. 1 more question: I place this in the On Open
event proc. correct?

Brotha Lee said:
Try the following that should work
with me.OLEUnbound0
.MaximumScale = Me![MaxScale]
end with

Regarding OWC charting there is lot to find on the web. Try google and you
will find lots of information and examples.

Miskacee said:
I know I sound like an idiot but will ask anyway, OWC - Office Web
Components? I'm not certain what I used, I just created the chart in Access.
Not certain what minorunit/majorunit being at 2 and 4 means. I don't want
to have a max unit and whenever I remove the number from the section I get an
error. I want the graphs to put the proper number on the Y axis, based upon
the data. Hope that makes sense. If I am to use OWC, how do I get that? I
added the proper reference I believe.

Thanks!

Brotha Lee said:
I think you have used an MS Graph instead of OWC?

The following should work:
With Me.myGraph.Axes(xlValue)
.MinorUnit = 2
.MajorUnit = 4
End With

:

I get an error saying, "cannot find the field max scale referred to in my
expression." This is the same error I got whenever I originally typed in the
original information. Do you have any suggestions?

:

Miskacee,

I think that the error is caused due the fact you have reference your axes
incorrectly. If you use a chart with only 1 y-axe (1) and x-axe (0) the code
should be something like this
Me![OLEUnbound0].Axes(1).maximumscale = Me![MaxScale]


:

I am trying to put the maximum number on the Y Axis automatically instead of
entering the maximum number. My numbers will change over time as more data
is added. I noticed the following code to add from another question from
someone.

Me![OLEUnbound0].Axes(2).maximumscale = Me![MaxScale]

However, I am not certain where to put this code. I added the reference
library but still get an error. Would I place the code on the open event to
the graph?

Thanks in advance for any assistance you can provide.
 
Think that would not be a problem. Only remember that the Me![MaxScale]
should have a value. Otherwise it will return null and can not set the
maximum scale. To avoid this you can either hard enter a default number in
the design mode. Better solution in my opinion is to replace Me![MaxScale]
with nz(Me![MaxScale],20). This will ensure that always a value (in my
example 20) will be returned if the MaxScale ccontains a Null value.

HTH

Miskacee said:
Thank you. I will try this. 1 more question: I place this in the On Open
event proc. correct?

Brotha Lee said:
Try the following that should work
with me.OLEUnbound0
.MaximumScale = Me![MaxScale]
end with

Regarding OWC charting there is lot to find on the web. Try google and you
will find lots of information and examples.

Miskacee said:
I know I sound like an idiot but will ask anyway, OWC - Office Web
Components? I'm not certain what I used, I just created the chart in Access.
Not certain what minorunit/majorunit being at 2 and 4 means. I don't want
to have a max unit and whenever I remove the number from the section I get an
error. I want the graphs to put the proper number on the Y axis, based upon
the data. Hope that makes sense. If I am to use OWC, how do I get that? I
added the proper reference I believe.

Thanks!

:

I think you have used an MS Graph instead of OWC?

The following should work:
With Me.myGraph.Axes(xlValue)
.MinorUnit = 2
.MajorUnit = 4
End With

:

I get an error saying, "cannot find the field max scale referred to in my
expression." This is the same error I got whenever I originally typed in the
original information. Do you have any suggestions?

:

Miskacee,

I think that the error is caused due the fact you have reference your axes
incorrectly. If you use a chart with only 1 y-axe (1) and x-axe (0) the code
should be something like this
Me![OLEUnbound0].Axes(1).maximumscale = Me![MaxScale]


:

I am trying to put the maximum number on the Y Axis automatically instead of
entering the maximum number. My numbers will change over time as more data
is added. I noticed the following code to add from another question from
someone.

Me![OLEUnbound0].Axes(2).maximumscale = Me![MaxScale]

However, I am not certain where to put this code. I added the reference
library but still get an error. Would I place the code on the open event to
the graph?

Thanks in advance for any assistance you can provide.
 
I may need to explain further. I'm counting resondents and providing a graph
of how many answered each question. Right now there are 10 people. As time
goes by, there will be more people, i.e. 50+. I want the Access graph to
update on the Y axis based upon the number of respondents after additional
data is added. Is this possible?

I didn't add the maximum number on the chart options because I don't want it
to max out and then more respondents are added than what the maximum number
entered shows.

Hope this helps in further explanation. Thank you so much for your help
thus far though!
 
Back
Top