On 2007 Nov 30, at 13:39, Neil Ticktin wrote:
Richard,
Interesting approach ... we'll look into that!
Of course, I can't just encounter a problem like this and walk away
without continuing to think about it, so I've come up with a
different approach, albeit one that also makes use of the Get
( PageNumber ) function.
In this one, you'd still have 2 index fields, as before, but they'd
be plain text fields, not calculated. And you'd write a script that
would go thru all the records you intend to print. Each time the
script encountered a new ODD page number, it would remember the
initial of the person (or company, or product, or whatever)
represented by THAT record (the topmost one on the left-hand page).
That info would be stored in a global field.
Then, whenever it encountered the next EVEN page number (the top of
the facing page), it would tag it in some manner to indicate "already
been here", back up 1 record (to the bottommost record on the left-
hand page), and insert the saved initial into that record's Left Page
Index field. That's the record whose value would appear in the footer
for that odd-numbered page.
Then onward again with the script. The very next record you encounter
is the one atop the facing right-hand page, and the page number
changes from odd to even. Aha! That means we've gotta back up a notch
and insert the saved initial, right? Wrong! We've already done that.
That's why, whenever we find a new even page number, we further
examine the record to see if it's been tagged as "already been here".
If it has, we keep on truckin'. (Apple headquarters may be at 1
Infinite Loop, but that's not a good place for your database to be.)
Eventually we pass from even page numbers to an odd one. Again, we
flag it as "already been here", back up 1 record, and insert the
appropriate initial from that very record into its own Right Page
Index field.
Then on to the very last record, which will require some kind of
special procedure to see what kind of index value it needs.
This is about the only way I can think of to associate the initial
for the topmost record on the left-hand page (which might be, say,
"D") with the index value of the bottommost record on that page
(which might itself have an initial of "F" or "G").
HTH. I also hope this will finally purge my brain of this puzzle.
Good luck.