Ann,
Be aware that the CLng/CSng functions return zero for non-numeric values, so
your results may not be as expected if one of your TextBoxes has letters in
it. Accordingly, you may want to consider some validation on the individual
TextBox values - possibly on the Exit or Change events of the TextBoxes -
before doing this comparison.
In addition, it is good coding practice to specify the property of the
control being evaluated explicitly, rather than just relying on the default.
So in Jean-Guy's code, for example, you would use:
With Me
If CLng(.Text1.Value) >
(CLng(.Text2.Value)+CLng(.Text3.Value)+CLng(.Text4.Value))
etc...
End With
--
Cheers!
Gordon
The Kiwi Koder
Uninvited email contact will be marked as SPAM and ignored. Please post all
follow-ups to the newsgroup.