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

List boxes

Status
Not open for further replies.

subnation

Programmer
May 9, 2001
2
US
I know it seems a bit stupid but...
I wish to have two option boxes, one under the other yeah..
Accessing the info for these list boxes from a db the info is going into the one box, where i want two seperate ones.

'ere is my code.

'----------------------------------------------------------
' execute the command, thereby populating the adoRS recordset
Set adoRS = adoCmd.Execute

Do while not adoRS.EOF

dim CatStrs, ValueSubs

call GetFullSubModelsDesc (adoRS, CatStrs, ValueSubs)
'--Gives year range & sub model--
Response.Write &quot;<option value =&quot;&quot;&quot; & server.HtmlEncode(ValueSubs) & &quot;&quot;&quot;>&quot; & adoRS(&quot;YearBegin&quot;).value & &quot; - &quot; & adoRS(&quot;YearEnd&quot;).value & &quot; &quot; & CatStrs & &quot;</option>&quot; & vbCrLf

Response.Write &quot;<option value =&quot;&quot;&quot; & server.HTMLEncode(ValueSubs) & &quot;&quot;&quot;>&quot; & adoRS(&quot;ModelDescription&quot;).value & &quot;</option>&quot; & vbCrLf
adoRS.MoveNext
Loop
'----------------------------------------------------------
I'd be grateful for any help ;)
 
where are your open and close SELECT tags?? Mise Le Meas,

Mighty :)
 
The list box works fine without the opening & closing <select> tags. The thing is if you do put them in, the loop creates a single list box for every entry. Placing the tags outside the loop is also futile as the listbox is created without the entries, they are printed to page...making an awful mess :)
 
subnation,

In the code that you display in your mail, can you outline what sections of code apply to which select box. Mise Le Meas,

Mighty :)
 
Instead of putting your response.writes inside of your loop, build your option tags for each listbox into string variables, one variable for each listbox. Then, when you're done with your loop, response.write each of the string variables (that now contain all the text needed to build a select element with all its options).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top