Jump to content

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

Recommended Posts

Posted

How can I validate the contents of a field based on the contents of another field? I tried (in validate by calculation):

If( field1 = "yes", field2 <> "yes", "")

but it didn't work. And then I thought, what exactly is the difference between putting a calc in the validate by calc area rather than just making the field a calc field? And then I remembered that I have other info I want to keep in that field and that I just want to make sure that both fields cannot = "yes" at the same time.

What am I doing wrong?

TIA,

KC

Posted

And then I remembered that I have other info I want to keep in that field and that I just want to make sure that both fields cannot = "yes" at the same time.

Why not make a third field that does just that? It would be you validator field, which is of course a calc field (no way around that I think).

You cannot have a calc field, and enter (manually) data into it at the same time. Its contents are either the result of a calc, or not.

You could also create a triad of fields, one being the calc field (A), one the manual field (:, and the finally one which is the master field ©, which is really just a calc field that says to use use (A) unless (: is not empty, in which case you use (: instead. You can even lay the (: transparently on top of © so it looks like one field, always returning the calc value of (A) unless you type in it -- in which case it would returned the manually entered value of (: in © instead. Then again, I'm just rambling on now, and the triad may not be a good idea at all in this case. smile.gif

You could also utilize relationships to validate certain variables, but you'd need extra fields there too to set it up.

HTH

  • 2 weeks later...
Posted

If the purpose of your validation is to make sure that both fields cannot be yes at the same time, then the validation for both fields would be:

Field1 <> "Yes" or Field2 <>"Yes"

With an appropriate message for each field warning the user.

There is no need for the "If" statement in a field validation.

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