I've been asked to make our internal telephone directory more 'intelligent'.

To do this I've added an extra field to the existing directory database and called it URL. This will effectively list a person's entry by their team.

I now need some help with the markup.

This line works;
Response.write("<TD class=helpbod><A Href=http://ksprod/ks/helper/3164.asp?selected=31>")
However it generates a static URL that only shows entries in the list that relate to the team members who have an entry of 31 in the Team field.

How do I make this code dynamic?

Here's the original search routine;
do until rs.EOF
a = rs.fields.item("postalsector")
b = rs.fields.item("MeterReadingTeam")
c = rs.fields.item("subareaname")
d = rs.fields.item("Depot")
Response.write("<TD class=helpbod style='width: 50pt;'>")
Response.Write(A)
Response.write("<TD class=helpbod>")
Response.Write(B)
Response.write("<TD class=helpbod><A Href=http://ksprod/ks/helper/3164.asp?selected=31>")
Response.Write(C) & "</A>"
Response.write("<TD class=helpbod style='width: 50pt;'>")
Response.Write(D)
Response.Write("<TR>")
rs.MoveNext
loop

rs.close
conn.close

Here's the new routine that doesn't work;
<TABLE CLASS=MeterR>
<td class=helphed style='width: 50pt;'>Post Code</td >
<td class=helphed>Reading Team</td></td>
<td class=helphed>Locality</td>
<td class=helphed>Depot</td>
<td class=helphed>URL</td></tr>
<tr>
<%
searchc=request.form("searchc")
postc=request.form("postc")



set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open "d:\knowledge solutions\publish\2232.mdb"
set rs = Server.CreateObject("ADODB.recordset")

rs.Open "SELECT * FROM MeterReaders where " & searchc & " like '" & postc & "%'", conn


do until rs.EOF
a = rs.fields.item("postalsector")
b = rs.fields.item("MeterReadingTeam")
c = rs.fields.item("subareaname")
d = rs.fields.item("Depot")
e = rs.fields.item("URL")
Response.write("<TD class=helpbod style='width: 50pt;'>")
Response.Write(A)
Response.write("<TD class=helpbod>")
Response.Write(B)
Response.write("<TD class=helpbod><A Href=http://ksprod/ks/helper/3164.asp?selected=<%rs1.fields.item("URL")%>>")
Response.Write(C) & "</A>"
Response.write("<TD class=helpbod style='width: 50pt;'>")
Response.Write(D)
Response.write("<TD class=helpbod style='width: 50pt;'>")
Response.Write(E)
Response.Write("<TR>")
rs.MoveNext
loop

rs.close
conn.close