Solved

Picture Control spans 2 pages in a report

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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

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…
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…
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…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

831 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