I have a table with a group of fields representing the result of a list of audit questions, with the answers stored as numbers 1,2 or 3 for yes, no, n/a. On a tip from this site I'm using a sum function as follows:
=Sum(IIf(1 In ([Rx1],[Rx2],[Rx3],[Rx4],[Rx4a],[Rx4b],[Rx4c],[Prac_notes1],
[Prac_notes1a],[Prac_notes1b],[Prac_notes1c],[Prac_notes2],[Prac_notes3],
[Prac_notes4],[Delivery1],[Delivery2],[Delivery3],[Dates1],[Dates2],
[Billing1],[Sup_stds1],[Adv_ben_notice1],[Residence1],[Facil_billing1],
[Facil_billing2],[Bill_device_not_del],[Patient_info1],[Insur_verif1],
[Insur_verif2],[Insur_verif3],[Insur_verif4],[HIPPA],[Chart_org1],
[Finance1],[Finance2],[Finance3],[Finance4]),1,0))
I have this in the controlsource of an unbound textbox on a report. The report is based on a query that includes all of these fields. I am not getting any syntax errors, but when I run the report it prompts me for parameters for each field listed within the expression one at a time. I'n not all that current on VB coding. Can anyone tell me where this has gone awry?
Bob
=Sum(IIf(1 In ([Rx1],[Rx2],[Rx3],[Rx4],[Rx4a],[Rx4b],[Rx4c],[Prac_notes1],
[Prac_notes1a],[Prac_notes1b],[Prac_notes1c],[Prac_notes2],[Prac_notes3],
[Prac_notes4],[Delivery1],[Delivery2],[Delivery3],[Dates1],[Dates2],
[Billing1],[Sup_stds1],[Adv_ben_notice1],[Residence1],[Facil_billing1],
[Facil_billing2],[Bill_device_not_del],[Patient_info1],[Insur_verif1],
[Insur_verif2],[Insur_verif3],[Insur_verif4],[HIPPA],[Chart_org1],
[Finance1],[Finance2],[Finance3],[Finance4]),1,0))
I have this in the controlsource of an unbound textbox on a report. The report is based on a query that includes all of these fields. I am not getting any syntax errors, but when I run the report it prompts me for parameters for each field listed within the expression one at a time. I'n not all that current on VB coding. Can anyone tell me where this has gone awry?
Bob