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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Drop Down ComboBox 3

Status
Not open for further replies.

LinuxGuy

Programmer
Nov 18, 2002
37
US
Help me sort this Out to Grab the Table ("Contacts") and from the field ("CompanyName") Insert them into a drop down box

<!--#include file=&quot;db.asp&quot;-->

<td bgcolor=&quot;#999999&quot;><font color=&quot;#999999&quot; size=&quot;-1&quot;>
<input type=&quot;text&quot; name=&quot;x_Date_Of_Order&quot; value=&quot;<%= x_Date_Of_Order %>&quot;>
</font><font color=&quot;#999999&quot;>&nbsp;</font></td>
</tr>
<tr>
<td bgcolor=&quot;#3366CC&quot;><strong><font color=&quot;#FFFFFF&quot;><font size=&quot;-1&quot;>Customer</font>&nbsp;</font></strong></td>
<td bgcolor=&quot;#999999&quot;><font size=&quot;2&quot;>

'// Below is the unsortted part im needing help with //

<select type=&quot;text&quot; name=&quot;x_Customer&quot; value=&quot;<%= Customer %>&quot;>
<%
sql &quot;select CompanyName from Contacts&quot;
while not rs.Eof
%>
<option value=&quot;<%=rs(&quot;id&quot;)%>&quot;><%=rs(&quot;Customer&quot;)%>
<%
rs.MoveNext
when
%>
</select>
 
you code only has one column required from your select statement so it would be

%>
<select type=&quot;text&quot; name=&quot;x_Customer&quot; value=&quot;Customer&quot;>
<%
sql &quot;select CompanyName from Contacts&quot;
while not rs.Eof
%>
<option value=&quot;<%=rs(&quot;CompanyName&quot;)%>&quot;><%=rs(&quot;CompanyName&quot;)%></option>
<%
rs.MoveNext
loop
%>
</select>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top