IIF Statement

unclefink

Registered User.
Local time
Today, 12:35
Joined
May 7, 2012
Messages
184
I am building a report which contains a subreport, the subreport may not always contain data in which case it just doesnt show up createing a huge gap in my "real report".

What I was wondering, is there a way to make "Null" returns report "nothing to report" if that is the case. If data does return, then it reports the data.

Hopefully that makes sense.
 
The way i would approach this is to have a query supply the data and put a dcount()>0 in the criteria against the relavant field that would indicate no data. This way the report only has valid data.
 
The way i would approach this is to have a query supply the data and put a dcount()>0 in the criteria against the relavant field that would indicate no data. This way the report only has valid data.

Looks like i'm half way there.
The query I have has ID, ReportDate, "Week Number" calculated by WeekNumber: Format([ReportDate1],"ww"), and Systems which is the data that I need reported.

The week number has a criteria pointing at a text box in another form, how would I introduce the Dcount criteria into the query?

Thank you in advance for the help.
 
The week number has a criteria pointing at a text box in another form, how would I introduce the Dcount criteria into the query?

Thank you in advance for the help.

That depends on what field would indicate no data. For example, if you had a form with sales data on it. The main form would be the customer details & OrderRef and the subform the ordered items. So a Dcount("ItemCode","OrderedItems","OrderRef='" & MainForm!OrderRef & "'") = 0 would show no orders for that customer. Is Systems that field?
 
That depends on what field would indicate no data. For example, if you had a form with sales data on it. The main form would be the customer details & OrderRef and the subform the ordered items. So a Dcount("ItemCode","OrderedItems","OrderRef='" & MainForm!OrderRef & "'") = 0 would show no orders for that customer. Is Systems that field?

Sounds pretty accurate. The data for this report is dependant on the week number which is indicated in a form text box. There is other data on the main form which is also dependant on the text box; however typically always has data in it, if not that equals 0 as its calculating numbers. The data on the subform is actual text data reporting information back if there is data to report.

I'm sorry if thats very confusing.
 

Users who are viewing this thread

Back
Top Bottom