'MacroName:028 'MacroDescription:creates 500 based on multiple 028s 'written by John Lavalie, Aug. 10, 2006 option explicit Sub Main Dim CS As Object Set CS = CreateObject("Connex.Client") dim bool, x%, y%, tag500$, subB dim tag028$(9), numbers$(9), labels$(9) subB = chr(223) & "b" tag500$ = "500 " bool = CS.GetField ("028", x% + 1, tag028$(x%)) do until not bool tag028$(x%) = mid(tag028$(x%), 6) x% = x% + 1 bool = CS.GetField ("028", x% + 1, tag028$(x%)) loop for y% = 0 to x% - 1 numbers$(y%) = left(tag028$(y%), instr(tag028$(y%), subB) - 2) labels$(y%) = mid(tag028$(y%), instr(tag028$(y%), subB) + 3) next x% = x% - 1 tag500$ = tag500$ & labels$(0) & ": " & numbers$(0) if labels$(0) <> labels$(1) then tag500$ = tag500$ & " (" & labels$(x%) & ": " & numbers$(x%) & ")" elseif x% > 1 then tag500$ = tag500$ & " (" & numbers$(1) & "--" & numbers$(x%) & ")" else tag500$ = tag500$ & " (" & numbers$(1) & ")" end if if right(tag500$, 1) like "[!.)]" then tag500$ = tag500$ & "." CS.AddField 99, tag500$ End Sub