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

List Box

Status
Not open for further replies.

mot98

MIS
Jan 25, 2002
647
CA
Hi all,

I want to creat a list box from the column names in one of my tables. However I want the list to start witht the 10th column and go to the end, how would I do this?

I know that there is something like oRS.Header command but I am not sure of the syntax.

Any help would be greatly appreciated.

Thanks,
mot98
[pc]

"Every day I learn something new, and forget 10 things I learned long ago!"
 
Hi Mot98,


Run a Query against your table just a simple one that gets a quick result but includes all the fields. Then with your recordset, do this:
<%

OptionStr = &quot;&quot;
For Each strField In RS.Fields
OptionStr = OptionStr & &quot;<Option value=&quot; & strField.Name & &quot; >&quot; & strField.Name & &quot;</Option>&quot;
Next
%>
Then:

<select name=&quot;FieldName&quot; >
<%=OptionStr%>
</Select>

I haven't tested all of that , but that is the idea... It works fine on SQL server. Maybe someone can tell us if it will work on other Databases. Oh and obviously that gets all the fields, I'm sure you can figure out how to skip the first 10.

Have fun.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top