Solved

Picture Control spans 2 pages in a report

Posted on 2011-03-04
4
383 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
  • 2
  • 2
4 Comments
 
LVL 57

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 500 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 57
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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

809 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