By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,863 Members | 879 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,863 IT Pros & Developers. It's quick & easy.

Second page of report blank

100+
P: 443
I have a report that is 12 inches wide, however the way the report is designed it can sometimes print only 8 inches. Here's what I do, the report has 18 fields that can be printed but because of the program sets up the report it can print anywhere from 5 to 18 of the columns. The used can choose what columns they want to print.
What I do is move those columns that don't need to print to the left = 0 and set them to visible = false. If the number of columns will fit on Portrait I get a second page that is blank. Everything that would have gone onto the second page has been moved to the left = 0. Margins are set correctly.
I know this is confusing but I hope someone will understand it and maybe be able to give me some direction.
Thanks again for any advise.
Mar 18 '18 #1
Share this Question
Share on Google+
10 Replies


100+
P: 443
I found the answer to this. I went into the setup and changed the column width to 8 inches. This worked to eliminate the second blank page. Is there a way to do this in VBA that way I could set it on the fly instead of making it a standard.
Mar 18 '18 #2

Expert 100+
P: 1,034
You could try to change the Width of your report as you 'hide' columns.
Mar 18 '18 #3

100+
P: 443
it's not the width of the report but the Column size that is in the page setup section. the original column size is 14. something and I manually changed it to 8 which worked. I would like to be able to change the column size according to the number of fields are being printed.
Mar 18 '18 #4

Expert 100+
P: 1,034
But if the report width is larger than the page width...
I think Access will print a blank page?
Mar 18 '18 #5

PhilOfWalton
Expert 100+
P: 1,430
I am confused. I suspect what you mean is that the user can select which fields he or she wants to print.

So my thoughts are that, if there is some sort of selected/not selected field for each control, you could have a minimum control width specified for each field (It probably will be different for each one, depending on the type of data to be printed).

So, after the required controls are selected, the report width can be calculated from the sum of the minimum widths of each control.
This should give an indication of whether to print in Landscape or Portrait.
If it won't fit in landscape, you need to set the can grow property for each control and the detail section to yes, or consider using a smaller font.

If it fits easily onto the paper, you can recalculate the control width as the minimum width * (report width - margins) / sum(minimum widths)

Hope that helps

Phil
Mar 18 '18 #6

100+
P: 443
The report width shows 13.125 and I have the column size in the page setup to 8 and it seems to work fine. Remember all 18 columns are on the page to begin with and it will not let me change the report width because of this. But I haven't tried changing the report width after the columns that are not used are moved to the left. In Access VBA how do I change the report width, this program so out as a runtime so editing the report in runtime I don't think I can do that, I maybe wrong.
Mar 18 '18 #7

Expert 100+
P: 1,034
To make is 90% of it's original width (with a click on the report):
Expand|Select|Wrap|Line Numbers
  1. Private Sub Report_Click()
  2.     Dim a As Report
  3.     Set a = Screen.ActiveReport
  4.     a.Width = a.Width * 0.9
  5.     'MsgBox a.Width
  6. End Sub
  7.  
Mar 18 '18 #8

NeoPa
Expert Mod 15k+
P: 31,418
Hi Luuk.

Remember that, for the code within the associated module of the report itself, it is able to reference itself simply as Me.

That would leave your code as :
Expand|Select|Wrap|Line Numbers
  1. Private Sub Report_Click()
  2.     Me.Width = Me.Width * 0.9
  3. End Sub
Mar 19 '18 #9

Expert 100+
P: 1,034
Hmmmz, i'm not an Access expert ;)
and in other languages (like C#) it's called 'this'

I have problems getting the languages apart, with all thos function names 'INSTR', 'INDEX', 'POS', 'SUB', 'INDEXOF', etc, etc which are doing the same thing, but just got a different name ;)
Mar 19 '18 #10

NeoPa
Expert Mod 15k+
P: 31,418
Well, you're doing a fine job anyway.

Access (VBA) is definitely different from other development languages and environments. Good to see you offering help even when it's just ideas without the finesse of a VBA programmer.
Mar 20 '18 #11

Post your reply

Sign in to post your reply or Sign up for a free account.