Report creating extra pages based on number of sub report entries (1 Viewer)

NLW-John

New member
Local time
Today, 15:07
Joined
Oct 31, 2018
Messages
2
Hello everyone.

I'm working on a simple purchase order database for my place of work. I have a report containing subreport that forms a purchase order.

The main report includes the delivery address, supplier information, order number etc. And the sub report contains the order details, item description, cost etc. They are connected via the order number and everything works correctly.

I have a macro that displays a single report (rather than all of them) so you can print that order, email it etc.

OPEN REPORT
Report Name: Purchase Order
View: Print Preview
Filter Name:
Where Condition:[PurchaseOrderTbl]![Order Number]=[Forms]![Purchase Order Reference]![Order Number]
Window Mode: Normal

The problem is, when I execute this macro it creates page for every entry on the sub-report (order details). So if I make an order which has 25 items, it creates 25 copies of the same report, all with the same information.

Is there a way I can get round this?

Be gentle, I'm new to all this.

Kind regards,


JB
 

isladogs

MVP / VIP
Local time
Today, 16:07
Joined
Jan 14, 2017
Messages
18,209
Welcome John
Your post was moderated for some reason so didn't appear at first.
I've approved it and hopefully you will get an answer soon.
However not many here use macros so you may have to wait a while
 

theDBguy

I’m here to help
Staff member
Local time
Today, 08:07
Joined
Oct 29, 2018
Messages
21,456
Hi JB,

I don't see anything in your macro that would cause the extra pages. If you open the report manually from the Navigation Pane, do you still see those extra pages? If so, I would think the problem might be with the report and not the macro.

Just my 2 cents...
 

JHB

Have been here a while
Local time
Today, 17:07
Joined
Jun 17, 2012
Messages
7,732
.. So if I make an order which has 25 items, it creates 25 copies of the same report, all with the same information.
..
That happen when the main reports Record Source contains more as 1 record, in the above case 25 records.
So what is the record source for the main report?
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 23:07
Joined
May 7, 2009
Messages
19,233
It has to do with the Main Report's Recordsource.
remove the Link of the Main Report's Recordsource from Order Detail.
 

Users who are viewing this thread

Top Bottom