Share via

does anyone know how to print a form if it is multiple pages? The code that works for a single page form is not working for a multiple page form

Anonymous
2012-05-09T02:16:58+00:00

I have created a report in Access 2010 so I can print single records from a form.  If the form is only 1 page then it prints fine, if the form is more than 1 one page it will only print the first page not the second page of the form.  When I go into print preview you can only see page one.  Does anyone know how to print a single record in a form if the form is multiple pages?

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

11 answers

Sort by: Most helpful
  1. Anonymous
    2012-05-10T11:42:35+00:00

    I think the real problem is that you are seeing a report as an expression of a form.  While Access includes the functionality it is no more than a cheap and cheerful solution to provide an instant report.  Forms and reports are really different types of expressions of the data intended for different purposes, and a form layout will rarely be entirely suitable for a report layout.

    Your problem will be solved if you create a new report based on the form's query and lay it out specifically as a report rather than a reproduction of the form.  The fact that the form has two pages will then be completely irrelevant.  As I said before, you can use the report wizard to avoid much of the tedious work of designing the report, though you'll probably find you have to do some fine tuning of the layout.  I'd be doubtful of your reaching a satisfactory solution by tweaking the current report.

    To see an example of a report which shows the current record from a form you might like to take a look at InvoicePDF.zip in my public databases folder at:

    https://skydrive.live.com/?cid=44CC60D7FEA42912&id=44CC60D7FEA42912!169

    You might have to copy the text of the link into your browser's address bar (not the link location).  For some reason it doesn't always seem to work as a hyperlink.

    This demo file includes quite a complex form, with three subforms within it, for entering an invoice.  From it a report can be opened of the current invoice with the Open Invoice button.  You'll see that the report is set out very differently from the form.  It does include one subreport, for the totals, but as far as I can tell your report would be even simpler as it will be based on a single query and not need any subreports.  The file also demonstrates how to output the report as a .PDF file, which is really the prime purpose of the demo.

    0 comments No comments
  2. Anonymous
    2012-05-10T00:58:47+00:00

    The way I have created two reports so far is:

    open the form

    file

    save object as

    click on down arrow and select report

    This does work for forms that are small but if the form is larger it only prints the first page.

    I might have to insert a page break as suggested.

    I am not sure how to use Skydrive but if I can work it out I will try and do a screen shot.

    Thank you everyone for taking time out to help, I will try a few things and see how I go.

    I think half the problem is is that I did not create the forms.

    Thanks again

    0 comments No comments
  3. ScottGem 68,810 Reputation points Volunteer Moderator
    2012-05-09T11:59:29+00:00

    What is not clear here is HOW you created the report. If you just saved the form as a report like Ken is suggesting, then you may have issues with exceeding the page size. You might be able to get away with inserting a page break at an appropriate point in the report. 

    But the real key here is that reports and forms are different. They have different purposes, different properties and different design techniques. Without seeing the form or the report its hard to advise here.

    Maybe you could load some screen shots like on SkyDrive so we can see what you are talking about.

    The code you are using will filter the report for the currently selected record. So the problem is probably in the report's design.

    0 comments No comments
  4. Anonymous
    2012-05-09T10:48:46+00:00

    I've never tried saving a form as a report myself; it's not something most developers would generally do.  But from your description it sounds like your form is beyond what this particular piece of functionality will cope with.  The problem may simply be that the controls as they appear in your form, when transferred to a report, exceed the physical length of a report's design area (558 mm if I remember correctly).

    I suspect you may have to bite the bullet and design the report yourself.  You can use the form's current RecordSource property as that of the report, and then add the relevant bound controls in whatever layout you wish.  Unlike in a form, in a report a bound control does not have to be as deep as necessary to hold all the data for it to be all visible.  The controls can be shallow, enabling you to fit many in the available design area, and provided that the CanGrow property of the control itself, and of whichever section of the report it is in (almost certainly the detail section in this case) is set to True (Yes) then the control will grow when the report is opened to allow all the data to fit, so it will be different depths in different rows depending on the data in each.

    You can use the report wizard to create a report, but you might find that by doing this you come up against the same problem of fitting the controls into the maximum design area allowed.  Using the wizard is worth a try as it can cut out a lot of tedious design work, but I suspect you might have to resort to laying out the report manually.  You may be able save a lot of effort by using the existing report as the starting point and amending its design.

    0 comments No comments
  5. Anonymous
    2012-05-09T04:04:59+00:00

    no, not just one field, because there are lots of fields they all will not fit on one page so the form is 2 pages and at the top of the form there are 2 tabs - page 1 and page 2 and you can click on them to go between pages

    0 comments No comments