VBA Do Not Display Blank Pages (1 Viewer)

randommetalguy

Registered User.
Local time
Yesterday, 19:58
Joined
Nov 25, 2008
Messages
52
Hey guys,

I have a three page report that I am trying to print. But, if the user does not want a diagram with the report then I set the diagram to visible.false.

With all three pages (including diagram) the detail section of the report has a height of about 22". If there are only two pages (without the diagram) the height is only 15". The problem is that it still tries to display the last page of the diagram as blank.

If DLookup("Diagram", "table") = "Yes" Then
Me.Detail.Height = 31320
Else
Me.Detail.Height = 21960
End If

Height is in TWIPS but it is not resizing automatically like I had hoped. Any suggestions?
 

SOS

Registered Lunatic
Local time
Yesterday, 16:58
Joined
Aug 27, 2008
Messages
3,514
Make sure the section where your item you set to Visible=False is located has the Can Shrink property set to YES.
 

randommetalguy

Registered User.
Local time
Yesterday, 19:58
Joined
Nov 25, 2008
Messages
52
I changed it and Can Shrink is now set to Yes, but I still have the same problem.
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 00:58
Joined
Sep 12, 2006
Messages
15,738
do it the other way

make the not required box small to start with, and set the can GROW to true.
 

SOS

Registered Lunatic
Local time
Yesterday, 16:58
Joined
Aug 27, 2008
Messages
3,514
If you can post the database I can try to take a look and see. It works better for my troubleshooting when I can actually see and play with the thing.
 

Users who are viewing this thread

Top Bottom