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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

transform odd value to even - thanks for your help!

Status
Not open for further replies.

accessuserit

Programmer
Nov 10, 2001
29
IT
I need help to define my value of maxscale and minscale of a graph. My request is that the number are forced to even value.
My formula now define the min and max value of scale:
------------------------------------------------------
Private Sub Form_load()
Dim valoremax As Variant
Dim valoremin As Variant
Dim diff As Variant
Dim scala As Integer
diff = valoremax - valomin
If scala <= 4 Then
scala = 2
End If
If diff < 10 Then
valoremin = [MinDiMIN] - 2
End If
If diff >= 10 Then
valoremin = [MinDiMIN] * 0.96
End If
If diff < 10 Then
valoremax = [MaxDiMAX] + 2
End If
If diff >= 10 Then
valoremax = [MaxDiMAX] * 1.04
End If
Me![Mychart].Axes(1).minimumscale = valoremin
Me![Mychart].Axes(1).maximumscale = valoremax
Me![Mychart].Axes(1).MinorUnit = scala
Me![Mychart].Axes(1).MajorUnit = scala
Me![Mychart].Axes(2).minimumscale = valoremin
Me![Mychart].Axes(2).maximumscale = valoremax
Me![Mychart].Axes(2).MinorUnit = scala
Me![Mychart].Axes(2).MajorUnit = scala
On Error Resume Next
End Sub
------------------------------------------

The value valoremin and valoremax in certain record are odd, and the unit of the graph are odd, is noto good.

Thanks for help!!!

Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top