A weight measurement exists and provides us with various numbers. However, there is always a reference weight, such as 100, thus the Min-Max will always be within 10%. (90 - 110).
It is the responsibility of the code to determine whether anything is acceptable or not. For example, if it is 89.9, that is NOT GOOD, but if it is 99.2, that is OK.
Sometimes a problem arises for no apparent reason because, despite being on the scale, it goes BAD, and other times it is not on the scale and goes OK.
This is the section of the code that is crucial; (Not mine code, I just have to fix it somehow)
If Val(txtWeight.Value) < Val(txtMinWeight.Value) Or Val(txtWeight.Value) > Val(txtMaxWeight.Value) Then
lblJudgement.Caption = "NOT GOOD"
Sheets("Measurment").Cells(j, 2).Value = "NOT GOOD"
lblJudgement.BackColor = 255
txtWeight.BackColor = 255
Call BadSound
Else
lblJudgement.Caption = "OK"
Sheets("Measurment").Cells(j, 2).Value = "OK"
lblJudgement.BackColor = 49152
txtWeight.BackColor = 49152
Call GoodSound
End If
As long as I see it, all the formulas, and calculations should be good, so I have no clue why it turns around sometimes and give back wrong judgments.