August 2, 200223 yr 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
August 6, 200223 yr 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. You could also utilize relationships to validate certain variables, but you'd need extra fields there too to set it up. HTH
August 14, 200223 yr 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.
Create an account or sign in to comment