Abd
06-04-2003, 09:23 AM
Hi All,
I have a situation where I am populating a Combo Box with the bellow code, but I now want to have two Combo Boxes. Scenerio is, if I load the form I want only the first Combo Box to be populated, then when I select a value from the first Combo Box, the second Combo Box should be populated, that is the selected value of the first Combo Box should be used for the "where" clause of the second Combo Box. The data that is used for populating both Combo Boxes are in the same table and Database. Bellow is my code;
<%
'Populating Source ComboBox
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.open "DSN=dsn;UID=uid;PWD=pwd;DATABASE=DB"
Set rs=oConn.execute("Select source from services where source <> 'NULL'")
response.write "<b>Source:</b> <select name='source'>"&vbcrlf
while not rs.eof
response.write "<option value="""&rs("source")&""">"&rs("source")&"</option>"&vbcrlf
rs.movenext
wend
response.write "</select>"&vbcrlf
rs.close
set rs=nothing
oConn.close
set oConn=nothing
%>
thanks
Abd
I have a situation where I am populating a Combo Box with the bellow code, but I now want to have two Combo Boxes. Scenerio is, if I load the form I want only the first Combo Box to be populated, then when I select a value from the first Combo Box, the second Combo Box should be populated, that is the selected value of the first Combo Box should be used for the "where" clause of the second Combo Box. The data that is used for populating both Combo Boxes are in the same table and Database. Bellow is my code;
<%
'Populating Source ComboBox
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.open "DSN=dsn;UID=uid;PWD=pwd;DATABASE=DB"
Set rs=oConn.execute("Select source from services where source <> 'NULL'")
response.write "<b>Source:</b> <select name='source'>"&vbcrlf
while not rs.eof
response.write "<option value="""&rs("source")&""">"&rs("source")&"</option>"&vbcrlf
rs.movenext
wend
response.write "</select>"&vbcrlf
rs.close
set rs=nothing
oConn.close
set oConn=nothing
%>
thanks
Abd