>>I think your logic is wrong. If you skip within the Do While, before the Replace, the first record with the *next* GroupHeading will be blanked. Try this.
>>
>>
>>LOCAL m.FirstTime, m.CurrentGroupHeading
>>m.FirstTime = .T.
>>
>>SELECT WorkListXMLCursor
>>SET ORDER TO TAG GroupHeading
>>m.CurrentGroupHeading = GroupHeading
>>
>>SCAN
>> * Never replace the first record
>> IF m.FirstTime
>> m.FirstTime = .F.
>> LOOP
>> ENDIF
>> IF GroupHeading = m.CurrentGroupHeading
>> REPLACE GroupHeading WITH ''
>> ELSE
>> m.CurrentGroupHeading = GroupHeading
>> ENDIF
>>ENDSCAN
>>
>>
>>Untested....
>
>I'm wondering why you all keep suggesting untested ideas while this thread has a simple solution already?
Sorry, I didn't read all the replies. I see your solution is the same as mine -- actually a little simpler because no extra variable to keep track of first-time-through.
So today is Naomi Nosonovsky Day on the UT. All praise her!!!!