Best way to filter to avoid duplicate pages in report

mikenelena

Board Regular
Joined
Mar 5, 2018
Messages
76
We print single page reports and e-mail them to clients. When a client has multiple e-mail addresses (stored in a table), the report prints a duplicate page in the pdf document for each e-mail address. We would like only 1 page to print.

If this is to be solved through a filter, should that be done by setting criteria on the query, or in the filter setting on the report itself? Or, might I be better off pursuing a way to specify the print range of the pdf? (To save time on the query.)

I've tried all 3 methods. Setting criteria on the query does in fact limit the number of returned rows to 1, but then inexplicably (to me at least), the report fields are all blank. Setting the filter on the Report simply doesn't filter anything at all. I have tried experimenting with Do.Cmd.PrintOut, but I cannot find an example of how to specify the file name and path with this method such as I can with Do.Cmd OutputTo.

If someone can point me in the right direction, I'd greatly appreciate it!

Thanks!
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.

xenou

MrExcel MVP
Joined
Mar 2, 2007
Messages
16,836
Office Version
  1. 2019
Platform
  1. Windows
Have you investigated the data source for the report? It is likely it involves a join to email address information and this query/join needs to be tweaked to take only the default or primary email address.
 
Solution

mikenelena

Board Regular
Joined
Mar 5, 2018
Messages
76
Have you investigated the data source for the report? It is likely it involves a join to email address information and this query/join needs to be tweaked to take only the default or primary email address.
I have, BUT... only on the final query. This query pulls from another intermediate query. Maybe your idea will work on that step. I'll try it this afternoon. Thanks!
 

xenou

MrExcel MVP
Joined
Mar 2, 2007
Messages
16,836
Office Version
  1. 2019
Platform
  1. Windows
Great. Post back if you run into any difficulties.
 

mikenelena

Board Regular
Joined
Mar 5, 2018
Messages
76
Xenou's suggestion worked. I was too fixated on the final query, and hadn't considered that an intermediate query might be a more appropriate location for the filter. Thanks very much!
 

Forum statistics

Threads
1,141,400
Messages
5,706,212
Members
421,432
Latest member
yash0468

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top