Counting records in the results of a sub-summary
I am working with a financial file that sorts in a sub-summary field called Underwriter. Each record has a field called Ranking. There are roughly 300 records and when sorted by Underwriter and Name, I may have 25 groupings with the Underwriter listed in each sub-summary field. In that grouping are the companies that match that field. I need to come up with a procedure, function, etc, to put a sequential number in all the records within each company for each of the underwriters. Each grouping must start out with 1 and incrementally increase by one. It cannot be 1 moving up through all the 300 records. It needs to signify the rankings for each sub-summary. Thank you for your attention to this.