Unable to display data using drop down list
Hi all, I needed some help on displaying data using drop down list. I'm able to see the drop box. But when i try to select from the list to display the information from access it doesnt show. There is no error but it is unable to display the table.
Here is the form.
<form name="InputForm" method="post">
<table border="0" cellpadding="5" cellspacing="0" bordercolor="#FFFFFF">
<tr>
<td><select name="tEquipmentCode" style="font-size:10px">
<%
sSQL = "SELECT EquipmentCode, EquipmentName FROM Equipment ORDER BY EquipmentCode"
rs.open sSQL, conn, 1, 3
do while not rs.eof
%><option value="<%=rs("EquipmentCode")%>" <% if rs("EquipmentCode")=sEquipmentCode then response.Write("selected")%>><%=rs("EquipmentCode" )%> -- <%=rs("EquipmentName")%></option><%
rs.movenext
loop
%>
</select></td>
<td><input type="submit" value="Add" name="btn_add"></td>
<td><input type="submit" value="Edit" name="btn_edit"></td>
<td><input type="submit" value="Delete" name="btn_delete"></td>
<td><input name="button" type="button" onClick="javascript:window.close()" value="Close"></td>
</tr>
</table>
<table border="1" cellspacing="0" cellpadding="5" width="100%">
<tr>
<td colspan="5"><b><%=Session("UpdateStatus")%></b></td>
</tr>
<tr>
<th width="24%" bgcolor="lightgrey">Equipment Code</th>
<th width="44%" bgcolor="lightgrey">Equipment Item Code</th>
<th width="12%" bgcolor="lightgrey">Item</th>
</tr>
<%
query_displayEquip = "Select * From EquipmentItem where EquipmentCode='"&sEquipmentCode&"' Order By EquipmentItemCode"
Set rs_displayEquip = Server.CreateObject("ADODB.Recordset")
Set rs_displayEquip = conn.Execute(query_displayEquip)
response.write(selected)
while NOT rs_displayEquip.EOF
%>
<tr>
<td align="center"><%=rs_displayEquip("EquipmentCode") %></td>
<td><%=rs_displayEquip("EquipmentItemCode")%></td>
<td><%=rs_displayEquip("Item")%></td>
</tr>
<%
rs_displayEquip.MoveNext
Wend
%>
</table>
</form>
Pls Help..thanks u all..
|