i need code to go along with my Dropdown feild that Grabs the Vendors Company Name, ("vendorName" from the Table Vendors and Places it into a dropdown Box
I am assuming you already have a connection object named objCon. The following code will populate a drop down menu with the values from the vendors database:
<select name="customer">
<%
strSQL = "SELECT * FROM Vendors"
Dim rs
Set rs = Server.CreateObject("ADODB.Recordset"
this is what i have So far
</tr>
<tr>
<td bgcolor="#3366CC"><strong><font color="#FFFFFF"><font size="-1">Customer</font> </font></strong></td>
<td bgcolor="#999999"><font size="2">
<select type="text" name="x_Customer" value="<%= x_Customer %>">
<%
sql "select * from Customers"
while not rs.Eof
%>
<option value="<%=rs("id"%>"><%=rs("Customers"%>
<%
rs.MoveNext
when
%>
</select>
<select type="text" name="x_Customer" value="X_Customer">
<%
sql "select Company from Contacts"
If Not rs.EOF Then
Do Until rs.EOF %>
<option value="<%=rs("Company"%>"><%=rs("Company"%></option>
<% rs.MoveNext
Loop
End If
rs.Close
%>
</select>
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.