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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Does detail section contain records??

Status
Not open for further replies.

RollingMoose

Programmer
May 13, 2002
73
US
I hope I explain this correctly...

I have a report where I hide and show labels in VBA depending on the page of the report. What I'd also like to do is hide and show labels depending on the number of records in my detail section for that specific page. For example, if no records are in my detail section for page 6 I'd like to hide a couple labels on that page only. Any suggestions or help is appreciated.
 
Access repeats the detail section for each record, so you're always going to have 1 record in that section.

Are you referring to the number of records which fit on the printed page?

 
Yes, sort of. What is happening is when I get to the last page of my report, there are no records remaining in the detail section. Since the detail section isn't displaying any records, I want to hide a couple labels and show a few others. So I'd like to be able to test if there are any records in a detail section on a given page. Hope that helps explain it....and thanks for the reply.
 
Sounds like, you have no records left to print, but you're getting an extra page. This can only happen if the detail section itself, or some section physically after it, couldn't fit on the same page with the last record. Access then forces another page to print anything remaining.

Rather than attempting to hide labels on the last page, you should stop that extra page from printing. It's not something you can rely on to regularly happen.

Try changing the KeepTogether property of the sections to yes/true. Also check if you have too much extra vertical space after the bottom controls in the Detail.

You can also try changing the CanShrink and CanGrow properties of Detail to true. If you need vertical space between the detail records, try putting it before, rather than after the first printed control.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top