Possible to export report to rich text with pages saved based on a field?

CSP12345

Board Regular
Joined
Oct 1, 2014
Messages
52
Morning all,

Just wondering does anyone know if it possible to export a report of numerous pages to a rich text and have the pages export separately with a name based on a field?

1. page 1. save as item code based on an item code field
2. page 2. save as item code based on an item code field

currently if I bring up the report on the selected criteria I only know how to export the whole lot of pages into one document.

Hope that makes sense?
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
1. page 1. save as item code based on an item code field
2. page 2. save as item code based on an item code field
You don't know that the filtered results of the report are on any particular page or range of pages, correct? So I presume you want to output a portion of a report (which is based on a query or table) based on some criteria. Then why not use the Docmd.OutputTo method to output the filtered query or table as an rtf file? It would probably be easier if a form provided the filter/criteria value and a query referenced the form control as criteria. You could then output the query each time a form command button was clicked. Or I presume that in vba, you could create a query def inside of a loop and output the query def. You can also set the record source for a report at run time and output a filtered report to rtf. More than one way to skin this cat.
 
Upvote 0
The report is based on a filtered set of dates returning 1 page per result, if I were simply to export to rtf or even print to PDF the exported will be 1 file, I am looking to create separate files with the name being derived by a field?? Is that possible?
 
Upvote 0
Yes. I'd create a record set and loop through it, exporting the report and use the field value as the file name, once for each record in the record set. If you need help, you'll have to provide more information about the report's underlying record set and where the date values are coming from. I have no idea if the date and name data comes from the report query or separate places. Nor do I know if the report is filtered by some form control such as a textbox or combo box holding a date value.
 
Upvote 0

Forum statistics

Threads
1,221,814
Messages
6,162,135
Members
451,743
Latest member
matt3388

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
Back
Top