HI Ray - just looking at this again today. Couldn't really get it to do what I wanted, probably because of the data structure, and the way Country is part of the profile thing with other stuff. fortunately the County is also stored for most Agent companies in that flat table, so just using that instead. Means that Country will needed to be added there and as part of the keyword profile thing, but it will save a lot of bother.
I have spotted a weird thing to do with records not adding adding up in a couple of recordset - have posted separately about that rather than add it here.