Question about Reports in Microsoft Access

By rogerk ·
I would like to attach some flowchart pages to the end of each record in a report in Microsoft Access. For each record, there can be 0-5 pages of flowcharts, and the pages are saved as .jpg files. Each flowchart will take up an entire page. I have attempted several different ways of doing this, and each technique has exhibited different types of bizarre behavior. I currently have 5 footers added to the report, named "FlowChartPg1Footer" thru "FlowChartPg5Footer". Each footer is "grouped" on the field in the database that contains the path to the .jpg file ("FlowChartPg1" to FlowChartPg5"). Each footer has "Force New Page...Before Section" defined in its property window. I created the footers by going to "View"->"Sorting and Grouping" and defining groupings for FlowChartPg1 thru FlowChartPg5. Each one has a seperate grouping, and therefore a seperate footer.
Each footer contains one control, which is an image control. I have written VBA code in the database's visual basic editor that will load the correct jpg into the image control. (the image control must have an image path provided at design time [when the control is added] so, I point it to a default .jpg, then load the correct image file at run time). The code is contained in the FlowChartPgXFooter_Print() event for each footer (X representing the "page" number). It would seem to me that these footers would be added, if and only if the fields on which they are grouped contained data, which is exactly what I would want. So, if there are no jpgs pointed to by the record, then no pages would be added, and therefore no images displayed. Then for each FlowChartPgX field that contained data, an additional page would be added, displaying the jpg for that page.
What happens is that some records which have no jpgs actually have 5 pages shown which display the default jpg. Some records (correctly) have no additional pages added, and some records have one flow chart displayed (correctly), and then 4 pages of the default jpg, when only one jpg is present for that particular record. Any advise on a better (correct) way of accomplishing this would be greatly appreciated. I don't think this should be that difficult to accomplish, but it appears there is a key piece of information that I have not grasped.
Thanks for any help you can provide.

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Answers

Share your knowledge

Related Discussions

Related Forums