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

How to add blank pages to Access 2010 report

P: 2
I have a long report to print in Access. Sales groups are to be printed separately, double sided. Most sales groups have enough lines to print on the second page (therefore print front and back). Some sales groups do not have enough lines to require a second page. I need to insert a second page for those shorter groups in order to print each sales group on a separate page.

How can I add a second page when the line count is less than a fixed limit?
Jan 28 '19 #1
Share this Question
Share on Google+
5 Replies

Expert Mod 15k+
P: 31,494
Not easily. That's for sure.

Access handles single pages very flexibly, but I'm not aware of anything that's inbuilt to deal with pairs of pages. That said, you explain your requiremenet well and it does make sense. I expect you'll need to do some fairly complicated VBA coding if you want to get the desired result. Are you up for that? Bear in mind I have no solution to hand, but I may be able to help you make your way to one if you're interested in taking this further. It may get complex.
Jan 28 '19 #2

P: 2
I used VBA code in the Excel file to add enough blank lines to assure 2 pages per sales group before loading it into the Access table from which the report was generated. But the report ignores the extra blank lines even though they are in the table.
I'm not adept at VBA for Access, but I'm willing to follow your lead to get this resolved.
Jan 28 '19 #3

Expert Mod 2.5K+
P: 3,284

If NeoPa has not already done so, Welcome to Bytes!

I am unable to take a detailed look at this problem right now, but I believe you may be able to accomplish something using the OnFormat event of your report. I will take a closer look at this in the morning if I get a chance.

On a somewhat side note, your question raises an interesting possibility. I have not thought of doing the double-sided print for each item. This, I can imagine, would be very useful for many users, if we can get this to work.
Jan 29 '19 #4

Expert Mod 15k+
P: 31,494
If we're all happy then, may I suggest that we detail any suggestions clearly in the thread, but also work on a very basic Access 2010 database that has nothing in it but what is required for this issue.

Can I ask you to start the ball rolling by putting such a database together. Make sure that you include a copy of your table with the data in it and ready, but make sure the data is in a local table so that when we start looking at it we all have the data available to us without needing to link to something local only to you. Self-contained is the order of the day.

If there is any sensitive data in there then I suggest you deal with that before attaching the ZIPped database to your post. We aren't going to need or worry about what the data shows except in as far as it pertains to the problem at hand.

Do try to make all your posts as clear and meaningful as you can. We have more experience at that so we'll make sure we fill out what you don't when we need to.

This could be fun.
Jan 29 '19 #5

Expert Mod 2.5K+
P: 3,284
I may have figured it out, but it may be a bit wiggy (as Access Reports can sometimes be).

You may have to create a new report, as MS Access Reports can be a bit wiggy when you make lots of changes to them (I already said that, but it's good to keep in mind).

Group your Report by your "Sales Group". Ensure you have a header and a footer for that Group.

Double-Click the Sales Group header to bring up the properties window. In the Force New Page property, select "Before Section" (I know, strange, but you may soon see why). Right-Click the On Format property and select "Build". Add this:

Expand|Select|Wrap|Line Numbers
  1. Private Sub GroupHeader1_Format(Cancel As Integer, FormatCount As Integer)
  2.     Page = 1
  3. End Sub
Click on the Sales Group footer. Add a Page Break from the Report Design tools. You may move this page break all the way to the top of this section, but you must leave at least a little space to display the page break, otherwise it will always be hidden. Make sure the Force New Page property is set to "None". Right-Click the On Format property and select "Build". Add this:

Expand|Select|Wrap|Line Numbers
  1. Private Sub GroupFooter2_Format(Cancel As Integer, FormatCount As Integer)
  2.     Dim fIsOdd  As Boolean
  3.     fIsOdd = Not ((Page Mod 2) = 0)
  4.     Me.PageBreak0.Visible = fIsOdd
  5. End Sub
Make sure that PageBreak0 has the same name as the Page Break you just added to your report.

This might just work.

But it might just not--MS Access Reports can be a bit wiggy sometimes (I may have already mentioned that).

Hope this hepps!
Jan 29 '19 #6

Post your reply

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