I have several reports in MS Access where the height of the DETAIL section changes depending on the data that is being displayed.
the report displays for example stock of clothing products - that go from XS,S,M,L,XL,2XL,3XL,4XL - but some garments come in Short, Reg, Long. in these cases the height of the details section increases so there are actually 3 rows of data displayed instead of 1. VBA handles this an it works perfectly.
the problem I am having is that the variable PAGES, holds the total number of pages in a report.
this is calculated by MS Access when the report loads - based on the number of rows of data in the Record Source.
when the DETAILS section is formatted - quite often it causes the report to run onto an extra page (possibly 2).
but the PAGES variable is not updated.
every page of the report that previews/prints needs to show PAGE X of Y - so I need to know the total number of pages when the first page of the report is rendered.
I am really not sure how to solve the issue