Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Picture Control spans 2 pages in a report

Posted on 2011-03-04
4
Medium Priority
?
391 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

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

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

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

618 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