"
for i = 0 to uBound(arrFields)
response.write ""
if trim(arrFields(i)) = "Beat" then
s = "SELECT tblBeat.strDescription, tblContactBeat.refContactID " & _
"FROM tblBeat INNER JOIN tblContactBeat ON tblBeat.BeatID = tblContactBeat.refBeatID " & _
"WHERE (((tblContactBeat.refContactID)=" & rst("ContactID") & ")) " & strBeatOrderBy
set rst2 = cn.execute(s)
if not rst2.eof then
response.write ""
do
response.write "| " & rst2("strDescription") & " | "
rst2.movenext
loop while not rst2.eof
response.write " "
else
response.write " "
end if
else
if trim(arrFields(i)) = "DistributionList" then
s = "SELECT tblDistributionList.strDescription, tblContactDistributionList.refContactID " & _
"FROM tblDistributionList INNER JOIN tblContactDistributionList ON tblDistributionList.DistributionListID = tblContactDistributionList.refDistributionListID " & _
"WHERE (((tblContactDistributionList.refContactID)=" & rst("ContactID") & ")) " & strDistributionListOrderBy
set rst2 = cn.execute(s)
if not rst2.eof then
response.write ""
do
response.write "| " & rst2("strDescription") & " | "
rst2.movenext
loop while not rst2.eof
response.write " "
else
response.write " "
end if
else
offset = instrrev(arrFields(i), " ", -1, 1)
strField = right(arrFields(i), len(arrFields(i)) - offset)
if mid(strField, 4, 5) = "Email" then
response.write "" & rst(strField) & ""
else
response.write rst(strField)
end if
end if
end if
response.write " | "
next
response.write "
"
rst.movenext
wend
rst.close
response.write "