Solved

Picture Control spans 2 pages in a report

Posted on 2011-03-04
4
370 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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

760 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now