Mike,
Dana's answer is correct. You either need mulitple case's or mulitple if's, ie each condition needs te be tested separately.
As for using the case, it's just a habit of mine. I use it when a whole series of things have to be done dependent on the outcome of the previous. So much more readable than nested If's. In a complex record validation it has the advantage of stopping the validation after the first inconsistency
local Success
Success = TRUE
do case
case !Success
case !validationrule_1
Success = FALSE
case !validationrule_2
Success = FALSE
otherwise
pp = qq
endcase
do case
case !Success
case !validationrule_3
Success = FALSE
case !validationrule_4
Success = FALSE
otherwise
yy= qq
endcase
...
return Success
>Hi Gregory.
>
>I guess my question now is, do I have to put every "case" into this record validation rule? I mean, if I have several fields that need some sort of validating, do I then need to build a case for each and every one of them and expand on the example you provided? Something like,
>
>do case
>case SomecheckHere
> repl field with SomeCalculatedValue
>
>case AnotherCheckHere
> repl field2 with SomeOtherCalculatedValue
>.
>.
>.
>case area <> Length * Width
> repl area with Length * Width
>.
>.
>.
>
>endcase
>
>TIA
>
>Mike
>
>>Mike,
>>
>>Put the code in the Record Validation rule
>>
>>do case
>>case area <> Length * Width
>> repl area with Length * Width
>>endcase
>>
Gregory