Hi,

I have the following code which will allow the user to select the patient_id and a table in the main query.
<%
On Error Resume Next
SET oCmd=server.createobject(&#34;adodb.Command&#34
oCmd.ActiveConnection = &#34;DSN=xxxxxx;UID=xxxxx;PWD=xxxxx;&#34;
strSQLStatement = &#34;select pt_ID from my_patient_table&#34;
&#39;response.write (strSQLStatement) & &#34;<br><br>&#34;
oCmd.CommandText= strSQLStatement
oCmd.CommandType= 1
Set oRs= oCmd.Execute %>

<form name=&#34;LimitedQueryForm&#34; action=&#34;queryresult1.asp&#34; method=&#34;post&#34;>
<table border=&#34;0&#34; width=&#34;100%&#34;>
<tr>
<td width=&#34;10%&#34;> </td>
<td width=&#34;20%&#34;><b>Patient ID:</b></td>
<td width=&#34;20%&#34;>
<select name=&#34;Patient_ID&#34; size=&#34;1&#34;>
<% Do While Not oRs.EOF
For Each oField in oRs.Fields
If IsNull (oField) Then %>
</td>
<td width=&#34;13%&#34;><b>Table Name:</b></td>
<td width=&#34;37%&#34;><select name=&#34;LTDsqlTable&#34; size=&#34;1&#34;>
<option value=&#34;H&#34;>H </option>
<option value=&#34;L&#34;>L</option>
<option value=&#34;A&#34;>A</option>
</select> </td>
</tr>
</table>

<form NAME=&#34;THEFORM&#34; ACTION=&#34;queryresult1.asp?Reset=1&#34; METHOD=&#34;POST&#34;>
<p align=&#34;center&#34;><input type=&#34;reset&#34; value=&#34;Clear &#34; id=&#34;reset1&#34; name=&#34;reset1&#34;>
<input type=&#34;submit&#34; value=&#34;Query&#34; id=&#34;submit1&#34; name=&#34;submit1&#34;> </p>

<a href=&#34;queryresult1.asp?id=1&#34;> </a>


And in queryresult1.asp i have

the html form to select the fields from the table and it is linked to queryresult2.asp.

and in queryresult3.asp , i should give the sql statement

MyDb.dbSQL = &#34;SELECT &#34; & Fields & &#34; FROM [tablename] &#34; &&#34;where pt_mpi&#34; = patient_id

Here the patient_id is the one which is selected by the user in the first asp page. My question is how should i export that patient_id to the third asp page in which i should use that for my selection criteria.

Any input is highly appreciated.

Ron