Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Populating dropdown box

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,148
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Populating dropdown box
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Populating dropdown box - 6/10/2001 10:29:20 AM   
  bigtop

 

Posts: 15
Score: 0
Joined: 5/31/2001
From: USA
Status: offline
I need to be able to populate a dropdown box on an Access data
page with some values that are returned from a recordset. I'm
trying it like this
lstBox.add(rs"Name")
but I keep getting a type mismatch error, what am I doing wrong?
 
 
Post #: 1
 
 Re: Populating dropdown box - 6/10/2001 10:30:54 AM   
  century

 

Posts: 10
Score: 0
Joined: 6/7/2001
From: USA
Status: offline
hmmm in javascript it would be:

lstBox.add(new Option('<%=rs"Name"%>','<%=rs"Name"%>'))

but you can just populate it with my preferred technique:

<select name="lstBox">
<%
while(!rs.EOF)
{
info = rs("name")
Response.write('<option value="'+info+'">'+info
}
%>
</select>

(in reply to bigtop)
 
 
Post #: 2
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Populating dropdown box Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts