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

Fill a dropdown with values..? 1

Status
Not open for further replies.

kenjoswe

Technical User
Sep 19, 2000
327
SE
Hi all,
I have a dropdown list that I want to fill with 24 months something like:

<%
sql=&quot;Select distinct Months from Table1&quot;
rs.open sql,conn
%>

<select id=&quot;Date&quot; name=&quot;Date&quot;>

<%
for intColumn = 1 to 24
Response.write &quot;<option value=&quot;& rs.Fields(intColumn) &&quot;>&quot; & rs.Fields(intColumn) &&quot;</option>&quot;
next
%>
</select>

What have I missed?

/Kent J.

 
i = 1
do until rs.eof
if i = 25 then exit do
Response.write &quot;<option value=&quot;& rs(&quot;Months&quot;) &&quot;>&quot; & rs(&quot;Months&quot;) &&quot;</option>&quot;
i = I +1
rs.movenext
loop

Something like this
Regards,
Durug




 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top