C
Corey ....
I am trying to ADD the values of 3 label Caption IF they are a Numerical
Value.
I have used the LONG approach below, but it only works on the provision that
the user starts at the label63 then to the Label74 and thirdly to the
Label87.
But if the user starts at label74 or Label87, the below code does not add
the values and place the result into Textbox64.
How can i better code this to allow for ALL not matter what Labels are
numerical, and total the values in TextBox64, without having to add every
possible combinatiopn of the current code i have ?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If IsNumeric(Label63.Caption) = True And IsNumeric(Label74.Caption) = False
And IsNumeric(Label87.Caption) = False Then TextBox64.Value =
Val(Label63.Caption)
If IsNumeric(Label63.Caption) = True And IsNumeric(Label74.Caption) = True
And IsNumeric(Label87.Caption) = False Then TextBox64.Value =
Val((Label63.Caption)) + Val((Label74.Caption))
If IsNumeric(Label63.Caption) = True And IsNumeric(Label74.Caption) = True
And IsNumeric(Label87.Caption) = True Then TextBox64.Value =
Val((Label63.Caption)) + Val((Label74.Caption)) + Val((Label87.Caption))
TextBox64 = Format(TextBox64, "0.00")
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CtM.
Value.
I have used the LONG approach below, but it only works on the provision that
the user starts at the label63 then to the Label74 and thirdly to the
Label87.
But if the user starts at label74 or Label87, the below code does not add
the values and place the result into Textbox64.
How can i better code this to allow for ALL not matter what Labels are
numerical, and total the values in TextBox64, without having to add every
possible combinatiopn of the current code i have ?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If IsNumeric(Label63.Caption) = True And IsNumeric(Label74.Caption) = False
And IsNumeric(Label87.Caption) = False Then TextBox64.Value =
Val(Label63.Caption)
If IsNumeric(Label63.Caption) = True And IsNumeric(Label74.Caption) = True
And IsNumeric(Label87.Caption) = False Then TextBox64.Value =
Val((Label63.Caption)) + Val((Label74.Caption))
If IsNumeric(Label63.Caption) = True And IsNumeric(Label74.Caption) = True
And IsNumeric(Label87.Caption) = True Then TextBox64.Value =
Val((Label63.Caption)) + Val((Label74.Caption)) + Val((Label87.Caption))
TextBox64 = Format(TextBox64, "0.00")
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CtM.