Hi
Am I missing something?
I am trying to compare a field of which it should fall between 2 values which are LW_Less 5 and LW_Plus5 if the comparison falls between these 2 values it should turn the background colour of the box green. This condition is never met and the box always turns red.
I would be grateful for any help in resoving my problem
I have listed my code below.
Regards
Ian Clegg
Private Sub CalcPlusandMinus()
CalcWeight = CalculatedWeight
LW_Less5 = (LoadWeight / 100 * 95)
LW_Plus5 = (LoadWeight / 100 * 105)
If CalculatedWeight >= "' & LW_Less5 & '" And CalculatedWeight <= "' & LW_Plus5 &'" Then
MsgBox "True"
marker = "green"
CalculatedWeight.BackColor = 65280 'Green
Else
CalculatedWeight.BackColor = 255 'Red
marker = "red"
Me.Repaint
End If
End Sub
Am I missing something?
I am trying to compare a field of which it should fall between 2 values which are LW_Less 5 and LW_Plus5 if the comparison falls between these 2 values it should turn the background colour of the box green. This condition is never met and the box always turns red.
I would be grateful for any help in resoving my problem
I have listed my code below.
Regards
Ian Clegg
Private Sub CalcPlusandMinus()
CalcWeight = CalculatedWeight
LW_Less5 = (LoadWeight / 100 * 95)
LW_Plus5 = (LoadWeight / 100 * 105)
If CalculatedWeight >= "' & LW_Less5 & '" And CalculatedWeight <= "' & LW_Plus5 &'" Then
MsgBox "True"
marker = "green"
CalculatedWeight.BackColor = 65280 'Green
Else
CalculatedWeight.BackColor = 255 'Red
marker = "red"
Me.Repaint
End If
End Sub