February 9, 200521 yr Hello. I have four fields: -A ("total") -B ("correct") -C ("incorrect") -D ("blank") I want to validate fields B-D (always, no over-ride on data entry). I've asked for an error message to displayed any time the validation fails (i.e., B ~= A-C-D). I have two problems. First, the validation doesn't always work. How can I trouble-shoot this? And is there a way to "trigger" the validation for a field with data that were entered before the validation was set up? Second, I would like to validate field D, but it should not be flagged as invalid if the result (D=A-B-V) is 0, since 0 is a possible value. Thanks in advance. gwen
February 9, 200521 yr B = A-C-D (validation by calculation, Boolean) Your validation for D has V in it. What's that?
February 12, 200521 yr Author Hi. 'V' was a typo for 'D." More concretely, I'm attaching a screenshot to show you how it's set up. The fields to validate (correct, incorrect, blank, skipped) should add up to the Total, which is a global value (always the same for every record). What I am trying to achieve is a foolproof system to minimize errors in data entry (and in scoring of data prior to entry). If a person tries to enter a set of values that don't make sense (don't sum to total), I would like Validation to fail, and a message to be displayed (and ideally an electric shock -- but a beep will suffice). Initially, I set correct, incorrect, blank, and skipped to Validate by calculation, using the formula shown in the pic (attached) -- incorrect = Total - correct.... etc. And so forth. I'm wondering how the Validation works. They enter the values sequentially, so maybe the Validation is triggered only for the final (Skipped) field? But when I create a new record to test this, I still don't get a message displayed (yes, I have the box checked to display a unique error message for each field). Help? Gwen
February 12, 200521 yr Author Whoops... I hit Quick Reply on the last message, so I didn't get to attach the screenshot. Here it is. validate_calc.pdf
February 13, 200521 yr Still not clear. If 'V' is 'D', then your validation for D would read D=A-B-D, or 2D=A-B, or D=.5(A-. If A=B, D=0, and the validation would fail.
February 13, 200521 yr Author Sorry. Maybe it would be clearer with real names, instead of variables. I have 4 values (actually 5, but I'll stick with the original 4) Total (A) Correct ( Incorrect © Blank (D) I want to verify that A=B+C+D. A is a global value, whereas B,C, and D are scores that are computed and entered by hand. So, I want to verify that: B=A-C-D <--> correct = Total - incorrect - blank C=A-B-D <--> incorrect = Total - correct - blank D=A-B-C <--> blank = Total - correct - incorrect I would like validation to be triggered during data entry, and I'd like to know what's required to make this happen. thanks for your help. Gwen
February 13, 200521 yr OK, so now D=A-B-C, which makes more sense. Then you should enter B, C, D, and A and verify that A=B+C+D; flag it, if it is not. I don't see how you can then verify B, C, or D.
February 14, 200521 yr An alternative suggestion. (I have never liked the FMP validation.) Set up a field called, say, Result, as a calculated Text field. Result = Case (A = B+C+D, "", "Incorrect value(s)entered, Dopey! Fixit!") [ Do not calculate if all fields are empty.] Set up Result on your layout wthout borders and format the text as Bold Red. This will show as incorrect by default, even when the fields are empty at the start.
February 14, 200521 yr Author Sorry, I'm still struggling with how Validation is supposed to work. A is a global value (always set =100). B, C, and D are values that are entered, so isn't it these values that I need to validate? The other suggestion worked fine, but I would like to understand how, in principle, to use Validate by computation correctly. Thank you, Gwen
February 15, 200521 yr The trick with validation by calculation is this: if the calculation evaluates to 1 (or true) then the data entered is validated. If the calculation evaluates to zero (or false) then the data entered is not valid so FMP posts the warning.
Create an account or sign in to comment