Jump to content
Server Maintenance This Week. ×

Help with validating fields


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

Recommended Posts

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

Link to comment
Share on other sites

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? smile.gif

Gwen

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This topic is 7010 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.