Not show SubReport if no data

vinz4ever

New member
Local time
Today, 22:13
Joined
May 1, 2012
Messages
7
Hi,

I've been researching on how to hide a sub report if there is no data within.

Basically i have an access database that enables me to run a register report, now linked to the register reports is a subreport that is for special requirements, so if that particular employee has any special requirements it will appear on the subreport. The table for the special requirements is seperate and links using a learner ID.

I've gathered from my research to use the .HasData property as well as enabling CanShrink to yes, i've tried the canshrink and that brings it to one line but the subreport still appears. I want it to completely not show if the report brings out blank fields. I've tried using the .HasData property but cannot seem to find it even when using it in code. I have Access 2010, but the database is .mdb rather than .accd

Please help

Thanks

V
 
hi

try by making can shrink property in header/detail/footer to yes only. need not to use hasdata property
 
Many thanks, I have tried setting properties in subreport and main report canshrink = yes but still no luck.

On the same note, if some records on subreport are populated and some records are empty, how do i stop the empty ones from showing?

Thanks for your help

hi

try by making can shrink property in header/detail/footer to yes only. need not to use hasdata property
 
I would have thought that the advice given by rammudali was correct.

Could you double check.

Make sure the Sub Report itself has Can Schrink set to yes.

Suggest we solve one problem at a time if that is OK by you.
 
Hi, I've got it to work, did some digging around and found a working method! :)

copied from a website:

In Microsoft Access, how can I prevent records with blank fields from appearing in a report?
In Microsoft Access, to prevent records with blank fields from appearing in a report:
  1. Open your report in Design View.
  2. Right-click the square at the upper left, and then choose Properties.
  3. In Access 2010 and 2007, under "Property Sheet", click the General tab. In other versions of Access, in the Reports dialog box, select either the All tab or the Data tab.
  4. In the "Filter" text box, enter the text that you wish to filter. For example, if you wanted to leave out records where a field called "status" was blank, the filter would be: status <> ""
  5. Click inside the "Filter on Load" (Access 2010 and 2007) or "Filter On" (other versions) box, and then, from the drop-down menu, select Yes.
  6. Save your report, and then close it. From the View menu, select Layout Preview or Print Preview to view the filtered data.
 
This is known as "Hard Coding".

It works fine but not flexible.

If you are happy then fine.
 
Hi, i did double checked and i was getting blank rows.

Yeh sure thats fine. But i do not have any issues with either queries. Many thanks for all your assistance.

Best wishes:D

I would have thought that the advice given by rammudali was correct.

Could you double check.

Make sure the Sub Report itself has Can Schrink set to yes.

Suggest we solve one problem at a time if that is OK by you.
 
Hi Rammudali, many thanks but it works now therefore i no longer require assistance for this particular issue, although i'm sure i'll need some assistance elsewhere. Many thanks for your help once again.

V

Hi
better upload the db for the correct solution
 
I would have thought that the advice given by rammudali was correct.

Could you double check.

Make sure the Sub Report itself has Can Schrink set to yes.

Suggest we solve one problem at a time if that is OK by you.


How do you make a "Sub Report itself Can Schrink set to yes" I am using 2003 version?
 

Users who are viewing this thread

Back
Top Bottom