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

List Box not Drop Down 1

Status
Not open for further replies.

ptuck

MIS
Aug 8, 2003
130
US
Is it possible to create a list box and have it populated from an Access DB? The problem is my drop down boxes are too long and are taking up the whole screen (the real problem is users using 800x600 resolution). So I thought I would create a list box that only displays one row and they can just click the up/down arrow to move thru the list. I did do a search on the site, but did not find anything or maybe I am using the wrong word for a list box.

Thanks for your help,
Paul
 
just use a select tag and give it a size

e.g
<select size="12">
<option>1
<option>2
<option>3
<option>4
</select>


___________________________________________________________________

The answer to your ??'s may be closer then you think. faq333-3811
Join the Northern Illinois/Southern Wisconsin members in Forum1064
 
Hi...

Try this:

Dim rsData as recordset
Dim Conn as Connection
<TR>
<TD>Status :</TD>
<TD><SELECT style="WIDTH: 135px" name="EmpStatus" >
<OPTION></OPTION>
<%
Set rsData= Server.CreateObject ("ADODB.Recordset")
rsData.Open "Select Distinct Status From
Expat_EmployeeReg",Conn
Do While Not rsData.EOF %>
<OPTION value="<%=rsData("Status")%> "><%=rsData
("Status")%></OPTION>
<%rsData.MoveNext
Loop
rsData.Close
Set rsData= nothing%>
</SELECT></TD></TR>
Event you have same data in your field it will only show one time.Don't forget to declare the database
connection.

I hope this could help you n the one you need it.
 
Thanks for the response. I knew it had to be easy, but not quiet that easy.

The size worked fine, but I was hoping to only show one row and have it scroll thru the options. It appears the small as it will go is two rows. When I set the size to 1 it goes back to a dropdown box. Is there a way to only show one row and let the user scroll thru the options?
 
a better idea would be to make it a list box:
<select size="1" multiple>
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
</select>


Known is handfull, Unknown is worldfull
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top