It took about 6 hours of time to basically code the “Ordering by surnames within families” code. This was very similar to the Numbering by Surname code that I finished on August 29. The difference here is that the level-1 families remain the same, but the ordering within them changes. I figured I’d do the same thing: create the original report, then add the renumbered report sections to the end of the report and then delete the originals.
I got this working fine, until I realized that the Others Related Through Marriage and Everyone Else sections need to always be ordered by surname, whether the option is checked or not. So then I had to rework this in the code so that each report section optionally might renumber by surname. The tricky part here was that instead of replacing the complete report, I’d now be replacing just the last report section. It took a big of trial and error to get that working correctly.
Also I found out that my “Add to Surname List” routine did not add the surname if the person’s name was an exact duplicate of someone else’s. Fixed that.