I am trying to use an IIf statement in a textbox control called PatSex on a report. The textbox is bound to a field called PatSex on an underlying table. In report design mode I entered the following statement into the PatSex textbox control source property:
=IIf([PatSex]="M","Male","Female"
The property entry is accepted with no errors but when I run the report I get a #Error message displaying in the Sex field.
I did have this field validated on the table to be of length 1 Character and only "M" or "F" as valid entries but even when I remove all the validation and increase the allowable length to 6 characters I still get the same runtime error on the report.
Can anyone tell me where my thinking is going astray or why this code is not working?
Thanks in anticipation HowardB
=IIf([PatSex]="M","Male","Female"
The property entry is accepted with no errors but when I run the report I get a #Error message displaying in the Sex field.
I did have this field validated on the table to be of length 1 Character and only "M" or "F" as valid entries but even when I remove all the validation and increase the allowable length to 6 characters I still get the same runtime error on the report.
Can anyone tell me where my thinking is going astray or why this code is not working?
Thanks in anticipation HowardB