Need to print all subreports, must print NONE if there is no data

Laftrip

Registered User.
Local time
Today, 04:05
Joined
Apr 23, 2004
Messages
23
I have read all the hasdata posts, but in each of the cases I have read, the problem was that they needed to print a message in the Main report instead of the subreport, I need to be able to either:

1) Print the subreport (because I still need the header if there are no records), and make the first field show NONE; or

2) Print a different subreport if there are no records in the subreport I am trying to print. The substitute subreport would have the same header and a static field showing NONE.
 
Hide the textbox behind the subReport, it'll show when the subReport's empty
 
Rich said:
Hide the textbox behind the subReport, it'll show when the subReport's empty

Thanks for the reply, however it doesn't fix my problem. If the subreport prints, I can see NONE showing behind the text of the subreport... Is there a way to maybe do this with an If statement added somewheres?

Is there a way to say in vb at this section of the report, print this subreport, if there is no data, print this report instead?

I wonder if there is a place you can go an see all the VB code that builds the report, then someone could just go there and change what they need, I find Access Reports very hard to work with if you already know what you want. Does anybody know any other good sources or tutorials for Access Reports...

I'm beginning to think I'm pushing the boundaries of what Access Reports can do here...
 
I tried changing the background color of the fields of the subreport that the NONE shows throught to white, not transparent and I still see NONE, does that mean that somehow it appears on top of the subreport instead of behind?

In design view, it's definitely behind the subreport...
 
What are you actually trying to do, I can't see why the HasData method will not work for you
 
Rich said:
What are you actually trying to do, I can't see why the HasData method will not work for you

I'll explain again... I'm so close to fixing this I can taste it!

For the purpose of testing the hasData method, I have just created a macro that emits a beep.

If I open a subreport that has no data directly I hear the beep.
If I open the subreport via the main report, no beep!

Now, the actual problem, if there is no data in a subreport, I want to print a line that looks just like the ones that would print if there was data, except I want all the boxes to be blank except the first box that would read "NONE".

I have thought of adding a dummy record if there is no data with a Union in my sql query, but that would add it everytime.

To fix my problem I would need to either

A) Check in the Main report if a particular subreport has no data, then use another subreport instead with I will add NONE to myself, or:

B) Check in the Main report or subreport if there is no data, if so, requery with another sql statement to add a dummy recort.

God I wish I didn't have to print NONE, but it's required!

Thanks a million Rich and other people, this forum has been very good to me the last 2 weeks. I've been able to find most of what I need myself.
 
=IIf([yourSubReport].[Report].[HasData]," ","NONE") as the control source for your textbox
 
Rich, whoever you are, I don't know what you do for a living, but you've resolved my two biggest problems and made it look so easy. My project is practically completed now. Thanks a million.
 

Users who are viewing this thread

Back
Top Bottom