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

force skip page 1

Status
Not open for further replies.

GShen

MIS
Sep 26, 2002
561
US
I have a main report unbound with 7 subreports. SubReport #7 always needes to be printed on an odd page. (EG. I am sending the report to a copier which prints duplex). I created a dummy blank page (sub report #6), that I only want to print when it is a even page number. The bottom line is subreport #7 always needs to be printed by itself, it cannot be the back page of sub report 5. I am trying to do this without making 2 passes but I am starting to wonder.
I have found in on the ON OPEN for the blank report I can set the report to visible or not and it will print or not print the report, however, I have no criteria to set this to. Am I going about this the correct way ? If I get rid of the blank page (sub report #6), can I skip 2 pages at the end of subreport #5 ? I am sort of fumbling with this.
Any suggestions would be appreciated.

Remember when... everything worked and there was a reason for it?
 
Duane,
I figured you would get me jump started. When you say above, where are you referring to ? Do you mean within subreport 7, sub 6, sub 5 or somewhere else... as in the main report.
Thanks Duane. ... this has been 1 heck of a project. I think this is my last hurdle. I will have a similar problem with sub1 and sub2 but once I get this one remedied I can fix that one in a snap. :)

Remember when... everything worked and there was a reason for it?
 
I don't believe you would have any luck placing a pagebreak control in a subreport. I would place the pagebreak control in the main report above subreport7. You might have to place subreport7 in a new section by itself. Then in the On Format event of the section, use code like:
Code:
  Me.PageBreakControl.Visible = Me.[Page] MOD 2 = 0
Of course, this might send your report into an unending loop that totally consumes the processing power of your PC, over-heats the power supply, and causes a small fire that ignites your desk and burns your office. I always keep a small electrical fire extinguisher handing when coding ;-)

Duane
Hook'D on Access
MS Access MVP
 
Hey Duane,
I always check my take my phone off the hook before a make a change like this. :) Been there, done that. I am getting close to throwing the pc out the door.
---------------
I created a new dummy grouping like you said. I created a footer for it. On the format section of the footer, I put in your code but it does not recognize me.pagebreakcontrol.visible.
Am I missing a .dll ? I looked it up in help also, to no avail. Also, do I kill the blank report (eg. sub report 6) or is that one I should be trying to print or not print ?
Sorry to be a pest... nothing is easy.

Remember when... everything worked and there was a reason for it?
 
Did you add a pagebreak control to the new section as suggested? Is its name "pagebreakcontrol" or did you just blindly copy my code? The visible property won't display in the intellisense.

I don't think there is any reason for subreport6.

Duane
Hook'D on Access
MS Access MVP
 
Duane,
I think I have gotten stupid. I just realized you were talking about a page break control (which I never did before) and not a dummy page break section. I found this neat little tab at the top of my report which said PAGE BREAK! I feel like an idiot.

Ok here is what I did, now that I understand what you were saying.

I just added a page break control (called PageBreak) as the 1st thing right after the new section footer (called PageBreakSection). I then added to the section footer code Me.PageBreak.Visible = Me.[Page] MOD 2 = 0.
I deleted sub report 6 (useless). I moved sub report 7 (which is now actually my 6th sub report) as the 1st sub report in my footer (PageBreakSection). The other 5 are in the detail section.

IT WORKS!!!!!!!!! I still can't believe it. I made a copy of it 3 times, just in case. LOL.

THANKS!..... again!!

I now have to work on page 2 (sub report #2), which is driven by a stored procedure. I should be able to use a page break control with that also. I can probably use the NODATA control on that report to set the visible PageBreakCover control to true. Basically if there is no data, then skip a page. (NOTE: that report ALWAYS 1 page and prints inside the cover page). If there is no inside page to print, then I need to skip a page to start the next sub report. Make sense ??

I tried giving you a few stars. This was priceless.


Remember when... everything worked and there was a reason for it?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top