I have an Access DB with 2 tables: tbldirectory and tblPracticeAreas.
I have a search page (practice-search.html) where the user can pick an attorney practice area from a drop down list. Upon choosing the practice area the user is taken to an ASP page (practice-search-results.asp)that displays a list of attorney names corresponding to that practice area.
I can display the attorney names just fine. What I need help with is displaying the attorneys' names as hyperlinks. I want the user to be able to click the name which would then take them to another ASP page displaying the complete and full set of information about that particular attorney (i.e., address, tel, fax, email, web, etc).
I've searched for similar questions here but can't seem to find the answer. Can anyone help out there?
Kind regards,
~gilroda
Here's the practice-search-results.asp page code: See bolded code below for where I want to insert the hyperlink.
<%
Dim Sql
Set dbCCBA = Server.CreateObject("ADODB.Connection")
strDBPath = Server.MapPath("directory.mdb")
dbCCBA.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDBPath & ";"
Sql = "SELECT tbldirectory.fname, tbldirectory.lname, tbldirectory.ID_no, tbldirectory.firm, tbldirectory.address1, tbldirectory.city, tbldirectory.state, tbldirectory.zip, tbldirectory.phone, tbldirectory.fax, tbldirectory.email, tbldirectory.web, tbldirectory.pareas, tblPracticeAreas.PracticeName FROM tbldirectory, tblPracticeAreas"
If Request.Form("TypeSearch") = "Adoption" Then
Sql = Sql & " WHERE tbldirectory.ID_no=tblPracticeAreas.ID_no AND tblPracticeAreas.PracticeName='Adoption' ORDER BY tbldirectory.lname"
End If
If Request.Form("TypeSearch") = "Bankruptcy Law" Then
Sql = Sql & " WHERE tbldirectory.ID_no=tblPracticeAreas.ID_no AND tblPracticeAreas.PracticeName='Bankruptcy Law' ORDER BY tbldirectory.lname"
End If
If Request.Form("TypeSearch") = "Business Law" Then
Sql = Sql & " WHERE tbldirectory.ID_no=tblPracticeAreas.ID_no AND tblPracticeAreas.PracticeName='Business Law' ORDER BY tbldirectory.lname"
End If
Set rsCCBA = Server.CreateObject("ADODB.Recordset")
rsCCBA.Open Sql, dbCCBA, 3
%>
<%
If rsCCBA.BOF and rsCCBA.EOF Then%>
<h2 align="center" style="text-align: left">No results found.</h2>
<%Else%>
<%If Not rsCCBA.BOF Then%>
<h2 style="text-align: left">Here are the results of your search: "<%=rsCCBA("PracticeName")%>"</h2>
<br>
<%
Do While Not rsCCBA.EOF
%>
<div align="left">
<table BORDER="0" width="94%" cellpadding="3" style="text-align: left; border-collapse:collapse" cellspacing="1" height="21">
<tr>
<td width="500"><%=rsCCBA("fname")%> <%=rsCCBA("lname")%> <em><%=rsCCBA("firm")%></em> <%=rsCCBA("city")%>, <%=rsCCBA("state")%></td>
</tr>
<tr>
<td width="500">Practice Areas: <%=rsCCBA("pareas")%></td>
</tr>
</table>
</div>
<hr color="#C0C0C0" size="1">
<% rsCCBA.MoveNext
Loop
%>
<p>
<%End If%>
<%End If%>
<%
rsCCBA.Close
dbCCBA.Close
%>