I've written some VBA code on certain events, my first time so please be patient.
basically after I enter LW value I want it to check if the value of WR is between the range of -0.007 to 0.007 but not matter the value the if statement returns "Passed" always.
I've copied the code below could someone point out what I'm doing wrong
basically after I enter LW value I want it to check if the value of WR is between the range of -0.007 to 0.007 but not matter the value the if statement returns "Passed" always.
I've copied the code below could someone point out what I'm doing wrong
Code:
Private Sub LW_AfterUpdate()
Me.WD = (Me.QtyKG + Me.EW) - Me.LW
Me.WR = Me.WD / Me.QtyKG
If Me.WR >= Me.CheckOne & Me.WR <= Me.CheckTwo Then
Me.WC = "Passed"
Else
Me.WC = "Limit Exceeded"
End If
End Sub
EW = Empty Weight
LW = Loaded Weight
WD = Weight Difference
QtyKG = Quantity in Kg
CheckOne = -0.007
CheckTwo = 0.007
WR= Weight Ratio
Comment