Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

suppress main report records based on value of variable passed from subreport 1

Status
Not open for further replies.

BettyJ

Programmer
Jul 25, 2012
269
US
[ul]
[li][/li]
[/ul]
I am trying to create a report of patients who did not have certain kinds of appointments in a given date range.

I have a main report that lists patient name,patient id, DOB, physician and location. I have a subreport that lists needed appointments the patient had(date and type of appointment). My subreport also has a variable hadappt. If the pt had any of the needed appts then hadappt is set to 1 else 0. I am able to pass the variable back to the main report and display it in detailsb or groupfooter of patient. What I need now is suppress the main report if hadappt=1.

I am not able to do this. Can someone please help me with this? Thanks for all help in advance.
 
Firstly you will need to be using a Shared variable. The subreport will need to be at least 1 section prior to the one you will be suppressing based on its result. So if you have a group on Patient, place the subreport in GH. Hide all sections in subreport, format the subreport to suppress if blank, and the GH to suppress blank section. Format the section where the patient records are being displayed (either GF or details) to be suppressed with a formula that uses the variable returned from the subreport.

Hope this helps

Cheers
Pete
 
That worked perfect. I have been working on this from the morning.

I was using a shared variable. I was trying to suppress the details and then all the variables will be 0. When I followed the steps you wrote, I was able to get it at the first try itself.

Thank you so much.
Betty
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top