Maria Tique Posted June 28, 2005 Posted June 28, 2005 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?
PeterHW Posted June 28, 2005 Posted June 28, 2005 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
BrentHedden Posted June 28, 2005 Posted June 28, 2005 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.
comment Posted June 28, 2005 Posted June 28, 2005 Or Case ( Count ( testone ; testtwo ; testthree ; testfour ) = 4 ; Sum ( testone ; testtwo ; testthree ; testfour ) )
Maria Tique Posted July 5, 2005 Author Posted July 5, 2005 Hi Peter, Thank you so so so much, i greatly appreciate it. Thank you very very much. Bless your heart. Maria Tique
Maria Tique Posted July 5, 2005 Author Posted July 5, 2005 Thank you very very much for your effort and time. Thank you. Bless your heart.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now