IIF statement calculation

hedge

New member
Local time
Tomorrow, 00:45
Joined
Apr 6, 2010
Messages
4
HI i am trying to update a field by clicking a command button on my form. My problem is that this iff statement does not work if i calulate txt cubic *167 if i take away the *167 the statement works.

Not working
Private Sub Command80_Click()
Me.Air_actual = IIf(([txt cubic] * 167) > [txtkgs], ([txt cubic] * 167), [txtkgs])
End Sub

Working
Private Sub Command80_Click()
Me.Air_actual = IIf(([txt cubic]) > [txtkgs], ([txt cubic]), [txtkgs])
End Sub
 
All the references to the controls on the form should include Me.
 

Users who are viewing this thread

Back
Top Bottom