Jump to content

This topic is 7239 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Can you please help me!!!! I have 5 numeric textboxes in total. Textboxes are called testone, testtwo, testthree, and testfour. They should give me a sum on textbox 5 which i called "sum". The sum textbox should only be totaled if 1, 2, 3, and 4 have a numeric value. If any of the 1, 2, 3, or 4 textboxes have an empty value, then the 5th textbox (sum) should remain empty.

In other words, My 5th textbox should only sum up if all 4 textboxes have a value!!!Thanks. How should i write my calculation and where?

Posted

If your 4 fields are defined as number, create your fifth field as a calculation, result number and enter in the calculation box :

Case (

not (IsEmpty(FieldA) or IsEmpty(FieldB) or IsEmpty(FieldC) or IsEmpty(FieldD));

FieldA + FieldB + FieldC + FieldD ; ""

)

This will return an empty result ("") if any of the fields is empty, and the sum of all fields if none of the fields is empty. Note that the ";" can also be a "," depending on your language settings.

HTH,

Peter

Posted

There are several ways of making this work, but here is one idea -

Case

(

not Isempty ( Filter ( Box1; "0123456789" ) ) and

not Isempty ( Filter ( Box2; "0123456789" ) ) and

not Isempty ( Filter ( Box3; "0123456789" ) ) and

not Isempty ( Filter ( Box4; "0123456789" ) ) and

GetAsNumber (Box1) + GetAsNumber (Box2) + GetAsNumber (Box3) + GetAsNumber (Box4)

)

The evaluation part make sure that the first four fields have some kind of number in them, and then adds them up if true.

If the 5th box won't be entered into by the user, you could make #5 a calculated field. If so, maybe a auto-enter would be in order.

This topic is 7239 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.