Form printing multiple pages, Access 2010 (1 Viewer)

Sticky99

Registered User.
Local time
Yesterday, 23:43
Joined
Nov 9, 2019
Messages
61
Probably an easy fix, can somebody advise. I have a form with a subform, if the subform has more than one line item, the print output will print the number of copies that relate to the number of line items. All line items apprear on all the printouts, how can I just print one report?
 

GPGeorge

Grover Park George
Local time
Yesterday, 23:43
Joined
Nov 25, 2004
Messages
1,873
Uh oh. Printing forms? Probably there is a better way to get a printout of the required data than printing forms.
Why is this not set up as a report? Reports, unlike forms, are primarily designed to print out on paper. Forms can be printed, but as you've learned, it's not a very easy way to create that printout on paper.

There are different tools because there are different purposes. Reports--> paper. Forms -->on screen display.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 01:43
Joined
Feb 28, 2001
Messages
27,191
Sounds (roughly speaking) like an incorrectly structured report. I have to take a shot in the dark on this because you offered so little information.

I would first design a query that was the JOIN of the main form's data and the sub-form's data. The query would APPEAR to have lots of repeated data for each entity in the main form, repeated once for each line item.

Then I would build a report based on the JOIN query, using the report's Group Heading (and Footing, where appropriate) to congregate the repetitive data. Last, I would make the line items the detail records of the report.

EDIT: And of course, if you are actually printing a form rather than a report (as GPGeorge suggests), that might be a mistake anyway. Forms are oriented towards showing information piecemeal. Reports tend to be more wholesale. Depending on your sub-form's layout, it is possible that Access is building a series of snapshots, one for each line item, because of the way you laid out the form.
 

Sticky99

Registered User.
Local time
Yesterday, 23:43
Joined
Nov 9, 2019
Messages
61
Appologies, I didn't explain this very well! this is the event that is run to print the report on a button click. Does this make more sense?

"DoCmd.OpenReport "rptMainCEVAReport", acViewPreview, , "[MainFormID]=" & Me.MainFormID, 0"
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 02:43
Joined
Feb 19, 2002
Messages
43,293
Your example will preview the report, not print it. From the prewview, your user can choose the number of copies when it prints. To automate this, you probably want two buttons. One that previews like what you have, and the second to go directly to print. However, the print option needs to be in a loop.

Get the count of the subform records using dCount(). Then create a loop using that count that loops x times and prints the report inside the loop.
 

Users who are viewing this thread

Top Bottom