I have managed to put something together and used an array to capture the information for each output but it is only returning the list of all the states instead of
128 1 0 200 70
128 2 0 0 30
128 5 0 200 0
this is my new code
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
</head>
<body>
<%
Dim rs
set rs=server.createobject("ADODB.recordset")
txtSQL= "SELECT * FROM States"
Set rs=conn.Execute(txtSQL)
set rp=server.createobject("ADODB.recordset")
txtSQL= "SELECT * FROM PhysicianContact where physicianID ='" & REQUEST("id") & "'"
Set rp=conn.Execute (txtSQL)
PhySpecialty= request("PhySpecialty")
SELECT CASE Request("Validate")
CASE "1"
Updatequalifications
CASE ELSE
DisplayForm
END SELECT
Sub DisplayForm()
%>
<table width="593" align="center" style="BORDER-RIGHT: #000000 2px solid; BORDER-TOP: black 2px solid; BORDER-LEFT: #000000 2px solid; BORDER-BOTTOM: black 2px solid">
<FORM action="physicianqualifications.asp" method="POST" name="Register" onSubmit="return submitform(document.Register)">
<input type="hidden" name="Validate" value="1">
<input type="hidden" name="PhysicianId" value="<%=request("ID")%>">
<input type="hidden" name="PhySpecialty" value="<%=request("PhySpecialty")%>">
<p>
<tr><th colspan=5 style="BORDER-BOTTOM: black 2px solid"><strong>Qualifications</strong></th></tr>
<tr>
<th colspan="2"scope="row"><div align="left">What date will you be avaliable?</div></th>
<td colspan="3"><script>DateInput('orderdate', true, 'dd-MON-YYYY')</script></td>
</tr>
<tr>
<th colspan="5"scope="row"><div align="center"></div></th>
</tr>
<tr>
<th height="36" colspan="5"scope="col"><div align="left">Medical School</div></th>
</tr>
<tr>
<th width="148"><div align="left">Name<span class="style1">%</span></div></th>
<th width="91"><div align="left">Year </div></th>
<th width="118"><div align="left">State<span class="style1">%</span></div></th>
<th width="155"><div align="left">City</div></th>
<td width="144"><strong>Country</strong></td>
</tr>
<tr>
<td scope="row"><div align="left">
<input name="txtmedname" type="text" value="<% =request("txtmedname")%>"> </div></td>
<td><input name="txtmedyear" type="text" size="10" value="<% =request("txtmedyear")%>"></td>
<td><select name="states" >
<option value="<% =request("states")%>"></option>
<option value="Int">International</option>
<%
while not rs.eof%>
<option value="<% =rs("StateCode")%>" <%if rs("StateCode") = Request("states") then%> selected <%end if%> ><%=rs("StateName")%></option>
<%
rs.movenext
wend
%>
</select>
</td>
<td> <input name="txtmedcity" type="text" value="<% =request("txtmedcity")%>"></td><td><input name="txtmedcountry" type="text" value="<% =request("txtmedcountry")%>"></td>
</tr>
<tr>
<th colspan="5"scope="row"><div align="center"></div></th>
</tr>
<tr>
<th height="36" colspan="5"scope="col"><div align="left">Internship</div></th>
</tr>
<tr>
<th width="148" scope="row"><div align="left">Name</div></th>
<th width="91"><div align="left">Year </div></th>
<th width="118"><div align="left">State</div></th>
<th width="155"><div align="left">City</div></th>
<td> </td>
</tr>
<tr>
<th scope="row"><div align="left">
<input name="txtinternname" type="text" value="<% =request("txtinternname")%>">
</div></th>
<td><input name="txtintrenyear" type="text" size="10" value="<% =request("txtintrenyear")%>"></td>
<td><select name="statei">
<option value="<% =request("subSpecialty")%>"></option>
<%
rs.movefirst
while not rs.eof%>
<option value="<% =rs("StateCode")%>" <%if rs("StateCode") = Request("statei") then%> selected <%end if%> ><%=rs("StateName")%></option>
<%
rs.movenext
wend
%>
</select>
</td>
<td><input name="txtinterncity" type="text" value="<% =request("txtinterncity")%>"></td>
<td> </td>
</tr>
<tr>
<th colspan="5"scope="row"><div align="center"></div></th>
</tr>
<tr>
<th height="36" colspan="5"scope="col"><div align="left">Residency</div></th>
</tr>
<tr>
<th width="148" scope="row"><div align="left">Name</div></th>
<th width="91"><div align="left">Year </div></th>
<th width="118"><div align="left">State</div></th>
<th width="155"><div align="left">City</div></th>
<td> </td>
</tr>
<tr>
<th scope="row"><div align="left">
<input name="txtresiname" type="text" value="<% =request("txtresiname")%>">
</div></th>
<td><input name="txtresiyear" type="text" size="10" value="<% =request("txtresiyear")%>"></td>
<td><select name="stater">
<option value=""></option>
<%
rs.movefirst
while not rs.eof%>
<option value="<% =rs("StateCode")%>" <%if rs("StateCode") = Request("stater") then%> selected <%end if%> ><%=rs("StateName")%></option>
<%
rs.movenext
wend
%>
</select>
</td>
<td><input name="txtresicity" type="text" ></td>
<td> </td>
</tr>
<tr>
<th height="23" colspan="5"scope="col"><div align="left"></div></th>
</tr>
<tr>
<th scope="row" colspan="2"><div align="left">What is your Board Status<span class="style1">%</span></div></th>
<td colspan="4">
<input name="pbs" type="radio" value="1">BC
<input name="pbs" type="radio" value="2">BE
<input name="pbs" type="radio" value="3">None
<strong> As of year</strong>
<input name="txtpboardsyear" type="text" size="10" value="<% =request("txtpboardsyear")%>"></td>
</tr>
<tr>
<th colspan="5"scope="row"><div align="center"></div></th>
</tr>
<tr>
<th colspan="3" scope="row"><div align="left">What is your Current Practice Status?<span class="style1">%</span></div></th>
<td colspan="2"><select name="selstatus">
<option></option>
<option value="Residents">Residents</option>
<option value="Fellow">Fellow</option>
<option value="Military">Military</option>
<option value="Referred">Referred</option>
<option value="Unspecified">Unspecified</option>
</select></td>
</tr>
<tr>
<th colspan="5"scope="row"><div align="center"></div></th>
</tr>
<tr>
<td>
<select name="sel1" size="10" onChange="setOptions(document.qualifications.select1.options[document.qualifications.select1.selectedIndex].value);">
<option value="select State"></option>
<%
rs.movefirst
while not rs.eof%>
<option value="<% =rs("StateCode")%>" <%if rs("StateCode") = Request("sel1") then%> selected <%end if%> ><%=rs("StateName")%></option>
<%
rs.movenext
wend
%>
</select>
</td>
<td>
<table>
<tr>
<td align="center" valign="middle">
<input type="button" value=">>"
onClick="moveOptions(this.form.sel1, this.form.sel2);" /><br />
<input type="button" value="<<"
onClick="moveOptions(this.form.sel2, this.form.sel1);" />
</td>
</tr>
</table>
</td>
<td colspan="2">
<select name='sel2' multiple size=10></select>
</td>
<td> </td>
</tr>
<tr>
<th colspan="5"scope="row"><div align="center"></div></th>
</tr>
<tr>
<td colspan="5"><div align="left"><strong>Are you legally authorized to work in the United States?</strong>
<input name="btnpleg" type="radio" value="1">
Yes
<input name="btnpleg" type="radio" value="2">
No</div></td>
</tr>
<tr>
<th colspan="5"scope="row"><div align="center"></div></th>
</tr>
<tr>
<th colspan="5" scope="row"><div align="left">What is your work authorization status?</div></th>
</tr>
<tr>
<td colspan="5">
<div align="center">
<input name="workstat" type="radio" value="Us Citizen">Us Citizen
<input name="workstat" type="radio" value="Permanent Resident">Permanent Resident
<input name="workstat" type="radio" value="JI">JI
<input name="workstat" type="radio" value="H1B">H1B
<input name="workstat" type="radio" value="Other">Other
</div>
</td>
</tr>
<tr>
<th colspan="5"scope="row"><div align="center"></div></th>
</tr>
<tr>
<th scope="row"><div align="left">Spoken Langauages </div></th>
<td colspan="2"><div align="center">
<input name="txtplang" type="text" value="<% =request("txtplang")%>">
</div></td>
<td colspan="2"> </td>
</tr>
<tr>
<th colspan="5"scope="row"><div align="center"></div></th>
</tr>
<tr>
<th scope="row" colspan="2"><div align="left">Salary Minimum<span class="style1">%</span></div></th>
<th colspan="2"><div align="left">Expected Income<span class="style1">%</span> <div></div></th>
<td> </td>
</tr>
<tr>
<th scope="row" colspan="2"><div align="left">
<strong>$</strong>
<input name="txtpminsalary" type="text" value="<% =request("txtpminsalary")%>">
</div></th>
<td colspan="3"><strong>$</strong><input name="txtpexpsalary" type="text" value="<% =request("txtpexpsalary")%>">
<input name="saltype" type="radio" value="Hourly">
Hourly
<input name="saltype" type="radio" value="Annual">
Annual</td>
</tr>
<tr>
<td><div align="left">
</div></td>
<td colspan="2"> </td>
<td> </td>
</tr>
<tr>
<th colspan="5"scope="row"><div align="center"></div></th>
</tr>
<tr>
<th colspan="2" scope="row"><div align="left">Are you currently interviewing? </div></th>
<td colspan="2"><input name="pinterview" type="CHECKBOX" value="1">
Yes</td>
<td> </td>
</tr>
<tr>
<td colspan="5" scope="row"><strong>Would like a email notifications of any new Opportunity?</strong> <input name="pemaillist" type="checkbox" value="1"> Yes</td>
<td width="1"> </td>
</tr>
<tr>
<th colspan="5"><div align="center"></div></th>
</tr>
<tr>
<th colspan="5" ><div align="left">What is your primary motivating factor for leaving your current position? </div></th>
</tr>
<tr>
<th colspan="5"><div align="left">
<textarea name="txtreasonleaving" cols="80"></textarea>
</div></th>
</tr>
<tr>
<td colspan="5" align="center"><input type="button" value="Previous" onClick="history.back()"> <input type="submit" name="Submit" value="Next"></td>
</tr>
<tr>
<th colspan="5"><div align="center"></div></th>
</tr>
</table>
</form>
<%
end sub
Sub Updatequalifications()
strminsalary=request("txtpminsalary")
strexpsalary=request("txtpexpsalary")
if isnull(request("txtpminsalary")) or trim(Request("txtpminsalary")) = "" then strminsalary = "0" else strminsalary = request("txtpminsalary") end if
if isnull(request("txtpexpsalary")) or trim(Request("txtpexpsalary")) = "" then strexpsalary = "0" else strexpsalary = request("txtpexpsalary") end if
session("sel2")=split(trim(replace(request("sel2"),"'","''")),",")
'arrSelectedItems=Request.form("sel2")
set rspho = server.CreateObject("ADODB.Recordset")
txtsql="select * from physicianqualifications where physicianid = " & chr(39) & trim(request("physicianid")) & chr(39)
rspho.open txtsql, conn, 1, 2, adCmdText
if rspho.EOF then
rspho.Addnew
End if
rspho("PhysicianID") = Request.Form("PhysicianID")
rspho("PhyDateAvaliable") = Request.Form("orderdate")
rspho("MedicalSchool") = Request.Form("txtmedname")
rspho("MedYear") = Request.Form("txtMedYear")
rspho("MedState") = Request.Form("states")
rspho("MedCity") = Request.Form("txtmedcity")
rspho("medcountry") = Request.Form("txtmedcountry")
rspho("Internship") = Request.Form("txtinternname")
rspho("InternYear") = Request.Form("txtintrenyear")
rspho("InternState") = Request.Form("statei")
rspho("InternCity") = Request.Form("txtinterncity")
rspho("Residency") = Request.Form("txtresiname")
rspho("ResYear") = Request.Form("txtresiyear")
rspho("ResiState") = Request.Form("stater")
rspho("ResiCity") = Request.Form("txtresicity")
'rspho("LicenseStates") = arrSelectedItems
rspho("pBoardStatus") = Request.Form("pbs")
rspho("BoardStatusYear") = Request.Form("txtpboardsyear")
rspho("CurrentPraticeStatus") = Request.Form("selstatus")
rspho("LeagallyWork") = Request.Form("btnpleg")
rspho("SponsEmpVisaStatus") = Request.Form("workstat")
rspho("OtherLang") = Request.Form("txtplang")
rspho("SalaryMinimum") = strminsalary
rspho("SalaryExpected") = strexpsalary
rspho("PayType") = Request.Form("saltype")
rspho("PhyInterviewing") = Request.Form("pinterview")
rspho("ReasonLeaving") = Request.Form("txtreasonleaving")
rspho.update
rspho.close
set rspho = nothing
txtsql = "DELETE FROM statelookup WHERE physicianID = '" _
& trim(request("physicianid")) &"'"
conn.Execute txtsql
for r=0 to ubound(session("sel2"))
txtsql = "INSERT INTO statelookup (physicianID, LicenseStates) " _
& "VALUES ('" & trim(request("physicianid")) &"', '" _
& session("sel2")(r) & "')"
conn.Execute txtsql
'retrieve userID for the newly added user
physicianid = Request("physicianid")
specialty = Request("PhySpecialty")
set rs = server.CreateObject("ADODB.Recordset")
txtSQL = "SELECT distinct clientopportunity.opportunityID, physiciancontact.physicianID,"_
&"(CASE WHEN clientopportunity.CLocationState = Physicianqualifications.medstate THEN 50 ELSE 0 END) AS geography,"_
&"(case"_
&"when clientopportunity.salaryfrom = 0 then 0"_
&"when ((Physicianqualifications.salaryminimum - clientopportunity.salaryfrom) / clientopportunity.Salaryfrom) * 100.0 ='0' then 100"_
&"when ((Physicianqualifications.salaryminimum - clientopportunity.salaryfrom) / clientopportunity.Salaryfrom) * 100.0 < 10 then 100"_
&"when ((Physicianqualifications.salaryminimum - clientopportunity.salaryfrom) / clientopportunity.Salaryfrom) * 100.0 < 20 then 80"_
&"when ((Physicianqualifications.salaryminimum - clientopportunity.salaryfrom) / clientopportunity.Salaryfrom) * 100.0 <30 then 60"_
&"when ((Physicianqualifications.salaryminimum - clientopportunity.salaryfrom) / clientopportunity.Salaryfrom) * 100.0 >40 then 20"_
&"when ((Physicianqualifications.salaryminimum - clientopportunity.salaryfrom) / clientopportunity.Salaryfrom) * 100.0 >60 then 0"_
&"else 0 end"_
&"+case"_
&"when clientopportunity.salaryto = 0 then 0"_
&"when ((Physicianqualifications.salaryminimum - clientopportunity.salaryto) / clientopportunity.Salaryto) * 100.0 ='0' then 100"_
&"when ((Physicianqualifications.salaryminimum - clientopportunity.salaryto) / clientopportunity.Salaryto) * 100.0 < 10 then 100"_
&"when ((Physicianqualifications.salaryminimum - clientopportunity.salaryto) / clientopportunity.Salaryto) * 100.0 < 20 then 80"_
&"when((Physicianqualifications.salaryminimum - clientopportunity.salaryto) / clientopportunity.Salaryto) * 100.0 <30 then 60"_
&"when((Physicianqualifications.salaryminimum - clientopportunity.salaryto) / clientopportunity.Salaryto) * 100.0 >40 then 20"_
&"when((Physicianqualifications.salaryminimum - clientopportunity.salaryto) / clientopportunity.Salaryto) * 100.0 >60 then 0"_
&"else 0 end) AS salary"_
&",(CASE WHEN Physicianqualifications.medstate IS NULL THEN 0"_
&"WHEN Physicianqualifications.medstate = 'int' then 0 else CONVERT(int,clientopportunity.AMG)*10 END"_
&"+CASE WHEN Physicianqualifications.medstate IS NULL THEN 0"_
&"WHEN Physicianqualifications.medstate = 'int' then CONVERT(int,clientopportunity.IMG)*10 else 0 END"_
&"+CASE WHEN Physicianqualifications.medstate IS NULL THEN 0 ELSE CONVERT(int,clientopportunity.RESGRAD)*10 END"_
&"+ CASE WHEN Physicianqualifications.medstate IS NULL THEN 0 ELSE CONVERT(int,clientopportunity.PRACPHY)* 10 end) AS qualifi"_
&"FROM clientopportunity"_
&"LEFT JOIN physiciancontact"_
&"ON physiciancontact.physpecialty = clientopportunity.specialty"_
&"AND UPPER(physiciancontact.physicianid) = '128'"_
&"INNER JOIN Physicianqualifications "_
&"ON Physicianqualifications.physicianID =physiciancontact.physicianID;"
set rs = conn.Execute(txtsql)
next
alldata=rs.getrows
if IsArray(alldata) then
numcols=ubound(alldata,1)
numrows=ubound(alldata,2)
FOR rowcounter= 0 TO numrows
FOR colcounter=0 to numcols
mystring=alldata(colcounter,rowcounter)&","
response.write mystring
Next
response.write "<br>"
Next
response.end
end if
'Next
Session("physicianID") = Request.Form("PhysicianID")
Response.Redirect "questions.asp?ID=" & trim(session("PhysicianID"))
end sub
%>
</body>
<!--#include file="disconnect.asp" -->
</html>
thanks for all help given