Pulling null data into a subreport

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a report that I need to pull all data - even if it is blank. I am not
a very experience user - just learning as I go.
What I have is 4 tables. 1 main report with 3 sub reports.
the common data in all the tables is a code.
I need to, in my report, pull all data for the code from all tables. That
is working ok when there is data for the code in all tables. When there is
no data the subreport does not show up. If there is no data for a code in a
particular table I still need the subreport to show in the report even though
it is blank. Know what I mean? Can you help?
 
Hi Danielsonn

If I understand you correctly, you wish to see the sub-report be produced,
regardless of whether there is any data to display.

You could try modifying the query for each of the sub-reports to make them
union queries and the union part is designed to always pull a single row of
known data back (with at least one of the fields set to a value that would
never be returned normally).

For example if your normal query pulls back 3 fields, an autonumber, date
and text then you could set the query to
select yourquery
UNION ALL
Select TOP 1 -1,null,null......
FROM your table

The -1 will never be returned from your normal query so you can now identify
this in the report.

Of course this would then display on your report, so you now will need to
modify your report to suppress this row. You can do this by entering code
into the On Format event to hide the row if the known value is set
 
Back
Top