no data in subreport

M

Meryl

I have a report that has contact information for each family in our db
(separate page for each).

I have a subreport that lists all the emails for the family.

If there are no emails, I want to print "No emails on file".

I created a control box: =IIf([HasData],"YES ","No Email on File")
I put it in the detail section and nothing appears under either condition.

When I put it in the page footer for the subreport, the "Yes" appeared when
there was data, but #error appears when there is none. I can't figure out
what's wrong.
 
M

Marshall Barton

Meryl said:
I have a report that has contact information for each family in our db
(separate page for each).

I have a subreport that lists all the emails for the family.

If there are no emails, I want to print "No emails on file".

I created a control box: =IIf([HasData],"YES ","No Email on File")
I put it in the detail section and nothing appears under either condition.

When I put it in the page footer for the subreport, the "Yes" appeared when
there was data, but #error appears when there is none. I can't figure out
what's wrong.


Subreports with no data don't do anything so the text box
needs to be in the main report. (Try placing it on top of
the subreport control.) Set the text box's expression to
this kind of thing:
=IIf(subreportcontrol.HasData, "Yes". "No Email on File")

It seems like you would want to use "" instead of "Yes"??
 
D

Duane Hookom

You need to reference the subreport control name (might be the same as the
Source Object)

=IIf(srptCtlName.Report.[HasData],"YES ","No Email on File")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top