Hello All,
I am struggling with a program that compares min and max values in a subform with the value in the main form. I compare multiple elements, but the "Ni" element seems to be an anomaly as far as the code results go. When the mins and maxs are, for ex. 4-8, the code seems to work just fine. If main form value is 5, no label change, if the value is 3 or 9 it changes the label to "Low or High" appropriately and backcolors the element to red. BUT, when I have a min and max in the 9-11 or 8-12 range, things get interesting. 10.1 main form value results in "Low Ni", 9.5 results in "High Ni", 9.9 results in "High Ni", 8 results in "Low Ni", 15 results in "Low Ni".
I am confused why it can work with some mins and maxs and not others. It is the same code from the same table of numbers. I check other elements with the same code with no errors thus far.
Any direction would be appreciated. Code is below:
Code:
Private Sub Form_Current()
[Ni].BackColor = 11468799
[Label4778].Caption = ""
If [Heat Specification Subform1].Form![Ni Min] > [Ni] Then
[Ni].BackColor = vbRed
[Label4778].Caption = [Label4778].Caption + " Low Ni " + [Ni] + [Heat Specification Subform1].Form![Ni Min]
ElseIf [Heat Specification Subform1].Form![Ni Max] < [Ni] Then
[Ni].BackColor = vbRed
[Label4778].Caption = [Label4778].Caption + " High Ni " + [Ni] + [Heat Specification Subform1].Form![Ni Max]
End If
End Sub
Thank you!
-S