I have a form that will show information regarding business areas including subtotals for each area. The subtotals are calulated from an invisible subform that is tied to a query. Not all areas will return data and this gives me the #NAME? error. When I reference the subforms field as the calculated fields controlsource it works till there is no data and then gives me the #ERROR result.
I have used the HasData property in reports for the same information and it works well. In the report fields controlsource I placed the following code:
=IIf([rptActHoldSubRpt].Report.HasData=True,[rptActHoldSubRpt].Report!Text6,0)
The report returns a "0" when there is no data. I am trying to use the same basic controlsource for a form changing the code to:
=IIf([frmBusActHoldSubform].Form.HasData=True,[frmBusActHoldSubform].Form.Text6,0)
I have tried several variations on the syntax but still receive the #NAME? error. All documentation found has been very vague ( and here) if available. My VB skills are lacking to say the least... Any ideas on why this does not work for the form or how to make it work??? Thank you in advance for the help!
I have used the HasData property in reports for the same information and it works well. In the report fields controlsource I placed the following code:
=IIf([rptActHoldSubRpt].Report.HasData=True,[rptActHoldSubRpt].Report!Text6,0)
The report returns a "0" when there is no data. I am trying to use the same basic controlsource for a form changing the code to:
=IIf([frmBusActHoldSubform].Form.HasData=True,[frmBusActHoldSubform].Form.Text6,0)
I have tried several variations on the syntax but still receive the #NAME? error. All documentation found has been very vague ( and here) if available. My VB skills are lacking to say the least... Any ideas on why this does not work for the form or how to make it work??? Thank you in advance for the help!