Minding my &Ps and &Qs - page number confusion

Db properties include print footer with &P &Q (Page # of ##).

I am using a view action to call @Command([FilePrint]…) because I want to use a substitute form and control the document separation.

The user selects 1 to many docs, hits the print button and the job prints. All good.

Except, &Q is wrong. It appears that the ‘number of pages’, increases to something much larger than the actual number of pages so I wind up with the last printed page showing something like ‘Page 24 of 37’

I can’t find anything that allows me to control ‘number of pages’. I’ve searched the forum - no joy.

Am I missing something very basic or is this not right?

TIA for any pointers.

Doug

Subject: More info

The ‘number of pages’ changes as I play with the margins; specifically if I set all 4 of the ‘upper/lower’ margins to 0, then the page count matches the actual number of pages.

And the printut looks like crud with stuff all jammed up at the top and bottom.

Once you start playing with the upper/lower margins, the page count gets off.

???

For now, I’m dropping the ‘number of pages’ from the footer and just adding a final page that says ‘this is the last page’. A kluge but it works.

Any ideas?

TIA

Doug