Gwen Posted February 9, 2005 Posted February 9, 2005 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
transpower Posted February 9, 2005 Posted February 9, 2005 B = A-C-D (validation by calculation, Boolean) Your validation for D has V in it. What's that?
Gwen Posted February 12, 2005 Author Posted February 12, 2005 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
Gwen Posted February 12, 2005 Author Posted February 12, 2005 Whoops... I hit Quick Reply on the last message, so I didn't get to attach the screenshot. Here it is. validate_calc.pdf
transpower Posted February 13, 2005 Posted February 13, 2005 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.
Gwen Posted February 13, 2005 Author Posted February 13, 2005 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
transpower Posted February 13, 2005 Posted February 13, 2005 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.
Oldfogey Posted February 14, 2005 Posted February 14, 2005 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.
Gwen Posted February 14, 2005 Author Posted February 14, 2005 Very nice. That worked great. Thanks, Gwen
Gwen Posted February 14, 2005 Author Posted February 14, 2005 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
Vaughan Posted February 15, 2005 Posted February 15, 2005 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.
Recommended Posts
This topic is 7290 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