?
Solved

Picture Control spans 2 pages in a report

Posted on 2011-03-04
4
Medium Priority
?
388 Views
Last Modified: 2013-11-28
I have a report which prints information relating to a Stock Record. Generally speaking, the report header occupies about a third of the first page, then the repeating detail section can contain any number of photos which are printed also. ie 1 photo per record in the detail section. I have deliberately sized the picture control so the height is just under a half of the page height. So under normal circumstances, we get the header and first photo on page 1, and then pairs of photos on subsequent pages. The picture is not a bound control. The detail section contains a hidden bound text box control. This text box contains the path to the image file. Then in the OnFormat event of the report, I set the picture to display the required image.

However, there is a subreport in the header section which means that the report header can grow in height. If the report header grows to more than half the height of the page I would expect that the first photo should jump down onto the second page. But what actually happens is that Access prints part of the photo on page 1 and the remainder of the photo on page 2. I have got the Keep Together property of the detail section set to true.

So how can I stop this photo from spanning 2 pages?
0
Comment
Question by:TownTalk
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 58

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 2000 total points
ID: 35035970
You'll need to place page break control in the detail section and make it visible if your too far down the page.  Place the control at the top of the section.

You can determine where you are by the .Top property.

i.e.  If Me.Top > x then
          me.pgBreak.Visible = True
      Else
          me.pgBreak.Visible = False

JimD.
0
 

Author Comment

by:TownTalk
ID: 35035986
So page breaks dont have any effect if they are invisible? I didn't know that. I'll give it a go.......
0
 
LVL 58
ID: 35036539
<<So page breaks dont have any effect if they are invisible? I didn't know that. I'll give it a go....... >>

  Yes.  If the page break control is not visible, it's not processed.

  Not sure I understand why KeepTogether didn't work, although it is ingored if the section won't fit on a full page.  That doesn't sound like that's the case though, which is why I'm a bit confused on that.  makes me think something else it going on.  But try the page break.

JimD.
0
 

Author Comment

by:TownTalk
ID: 35036860
Yes that seems to work. I might need to tweak the value of x a little yet though.

I was confused at first because when I look at the page break properties window, the visible property is not listed although I can change it programaticaly.

I too wondered why the keep together property is not looking after me. I thought maybe it was because the picture control is unbound. So I made the height of my hidden text box the full 13cm height of the detail section. This had no effect either.

Anyway it's working now. Thanks for your help.

Ian
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question