Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

pass selected value from one combobox to fill next one

Status
Not open for further replies.

DougP

MIS
Dec 13, 1999
5,985
US
I have two combo boxes and I want the user to slect a Facility from one and then populate the second one with Chemicals found at that facility.
here is what I have so far
Code:
<%
	
	rtnCompany ="Foster Wheeler"

	Set fp_conn =  Server.CreateObject("ADODB.Connection")
	Set fp_rs_Facility = Server.CreateObject("ADODB.Recordset")
	Set fp_rs_Analyte = Server.CreateObject("ADODB.Recordset")

	'Set fp_rs_Analyte = Server.CreateObject("ADODB.Recordset")
	fp_conn.Open Application("IHDatabase_ConnectionString")
	SQLStringFacility ="SELECT Company, Facility FROM IndustrialHygiene GROUP BY Company, Facility HAVING (((Company) Like '" & rtnCompany & "%'));" 
	'response.write SQLStringFacility 
	fp_rs_Facility.Open SQLStringFacility, fp_conn, 1, 3, 1 
	fp_rs_Facility.movefirst
%>
<p class=MsoNormal align=center style='text-align:center'>
<select size="1" name="ddChooseFacility">

<option selected value="Choose Facility">Choose Facility</option>
     <%do while not fp_rs_Facility.eof%>

      <option><%=fp_rs_Facility("Facility")%></option>
      <%fp_rs_Facility.movenext%> <select size="1" name="D1"></select><%loop%></select></p>

<p class=MsoNormal align=center style='text-align:center'>
&nbsp;</p>

<p class=MsoNormal align=center style='text-align:center'>
<select size="1" name="ddAnalyte">

<option value="Choose Analyte" selected>Choose Analyte</option>
<option value="add Chemicals here">add Chemicals here</option>
</select></p>

<%set fp_rs =nothing%>
<%set fp_conn=nothing%>

where do I put the SQL string and open the recordset for the next combo box

DougP
[r2d2] < I Built one
 
If you have some nice working code, then please feel free to post it for the benefit of others in the same situation.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top