Jump to content

Validating field if other field(s) empty

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

Recommended Posts

Hello. I have 4 number fields: N1, N2, N3 and N4. I would like to validate the fields this way:

N1 has to have a value (I was thinking checking Not Empty here?)

N2 cannot be entered if N1 is empty

N3 cannot be entered if N1 and N2 are empty

N4 cannot be entered if N1, N2 and N3 are empty

I was playing with validating by calculation but was not able to make it work.

Thanks in advance for help.

FileMaker Version: 6

Platform: Windows 2000

Link to comment
Share on other sites

I played around with this. You need a validation by calc for each field to look at its previous field only. N4, for example, should have a validation by calc of:

If(IsEmpty(N3), 0, 1)

This will allow entry only if N3 is not empty. It assumes (by the other validations) that you can't get to N3 without N1 and N2 being filled. In my test, I checked the "Strict" box (so users can't override validation) and the "show custom message," where I typed the message "N1, N2 or N3 is empty. You cannot use this field yet."

Do the same for all three (N2, N3, N4), as:

N2 = If(IsEmpty(N1), 0, 1)

N3 = If(IsEmpty(N2), 0, 1)

N4 = If(IsEmpty(N3), 0, 1)

N1 is a special case. I tried simply checking the "Not Empty" box on validation, checking "Strict" and using the custom message "This field must contain data."

I've attached a small test file. See if this works for you.

Steve Brown

Link to comment
Share on other sites

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