Hiding Groups when no data is present

I have a report I am working on where I am breaking the records out by lines. One record may have 2 lines, one record may have 1 line, one record may have 3 lines. I thought the easiest way to do this would be to create a group for each line then hide the lines (groups) where there is no data present to prevent the blank lines in the report. I tried to write a module based on one of the fields being empty, it would set the visble property to false, but that does not work. Maybe it is just my code...? One of the fields that is Null is called nPP2AGO. The name of the report is PPReport. Anyone able to help. Maybe it would be easier to just dump each line into one Detail area? Thanks in advance!
nadermannAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

pootle_flumpCommented:
What happens if you set CanShrink to true (controls and sections)?

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jerryb30Commented:
What is the grouping factor, wherein you would get a group geader, but no data?
You should set a criteria for the report not to report when the grouping factor has null sub-values.
nadermannAuthor Commented:
Pootle-
I tried that but it didn't make any difference. The blank lines still appear in the report.

Jerryb30-
This report is built off of subqueries to obtain the data in one query. The data originally had 0's but using sub-queries with a left outer join the data now shows as nulls. The data was originally all on one long line in the query, but I need the lines stacked in the report. How do I "set a criteria for the report not to report when the grouping factor has null sub-values"?

Thanks.
Your Guide to Achieving IT Business Success

The IT Service Excellence Tool Kit has best practices to keep your clients happy and business booming. Inside, you’ll find everything you need to increase client satisfaction and retention, become more competitive, and increase your overall success.

jerryb30Commented:
Can you post the SQL for the report source?

nadermannAuthor Commented:
sure:

SELECT [PPs1&2].tTRACK, [PPs1&2].tDATE, [PPs1&2].nRACE, [PPs1&2].nDIST, [PPs1&2].nSURF, [PPs1&2].nCLASS, [PPs1&2].nEPR, [PPs1&2].nMLO, [PPs1&2].tPGM, [PPs1&2].tHORSE, [PPs1&2].nPP1AGO, [PPs1&2].tPP1TRK, [PPs1&2].nPP1DIST, [PPs1&2].nPP1SURF, [PPs1&2].nPP1CLA, [PPs1&2].nPP1SOR, [PPs1&2].nPP1CSF, [PPs1&2].nPP1FR1, [PPs1&2].nPP1FR2, [PPs1&2].nPP1FR3, [PPs1&2].nPP1AP, [PPs1&2].nPP1EP, [PPs1&2].nPP1SP, [PPs1&2].nPP1FX, [PPs1&2].nPP1LP, [PPs1&2].nPP1EEN, [PPs1&2].nPP1RPAC, [PPs1&2].nPP1RPER, [PPs1&2].nPP1ODDS, [PPs1&2].nPP1FSZ, [PPs1&2].nPP2AGO, [PPs1&2].tPP2TRK, [PPs1&2].nPP2DIST, [PPs1&2].nPP2SURF, [PPs1&2].nPP2CLA, [PPs1&2].nPP2SOR, [PPs1&2].nPP2CSF, [PPs1&2].nPP2FR1, [PPs1&2].nPP2FR2, [PPs1&2].nPP2FR3, [PPs1&2].nPP2AP, [PPs1&2].nPP2EP, [PPs1&2].nPP2SP, [PPs1&2].nPP2FX, [PPs1&2].nPP2LP, [PPs1&2].nPP2EEN, [PPs1&2].nPP2RPAC, [PPs1&2].nPP2RPER, [PPs1&2].nPP2ODDS, [PPs1&2].nPP2FSZ, PP3.nPP3AGO, PP3.tPP3TRK, PP3.nPP3DIST, PP3.nPP3SURF, PP3.nPP3CLA, PP3.nPP3SOR, PP3.nPP3CSF, PP3.nPP3FR1, PP3.nPP3FR2, PP3.nPP3FR3, PP3.nPP3AP, PP3.nPP3EP, PP3.nPP3SP, PP3.nPP3FX, PP3.nPP3LP, PP3.nPP3EEN, PP3.nPP3RPAC, PP3.nPP3RPER, PP3.nPP3ODDS, PP3.nPP3FSZ
FROM [PPs1&2] LEFT JOIN PP3 ON ([PPs1&2].tDATE = PP3.tDATE) AND ([PPs1&2].tPGM = PP3.tPGM) AND ([PPs1&2].nRACE = PP3.nRACE) AND ([PPs1&2].tTRACK = PP3.tTRACK);
jerryb30Commented:
I suppose it is too simple to add
WHERE nPP2AGO is not null
to end of SQL?  
Are you statinng that if any of the key fields are null to not have data under the grouping?  If so, relook use of left join in  report source.
Have you considered using subreports to stack your lines?  

nadermannAuthor Commented:
I think I got it.....based on Pootle's response I went back and yes, I did have the section set to CanShrink, but failed to do the same for the data within that section. Making sure both are set to CanShrink, all looks fine now! Thanks for your help!
pootle_flumpCommented:
Super - glad to here.
pootle_flumpCommented:
hear. I meant hear. I think I am turning dispeptic.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.