accessuserit
Programmer
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
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