Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

I need to add vb code that will add a new drop down list on a link / button click

Posted on 2008-06-19
3
Medium Priority
?
174 Views
Last Modified: 2013-11-27
I have an asp website where I have a drop down box which is connected to a sql database. All the options displayed in drop down are the records from the database. The problem is you can't have multiple options in a drop drop box which we really need here. I want to create a button or link (next to drop down box) which will add another drop down and let the user pick another option from the same database and will keep adding a drop down box until the user is done selecting items. Any thoughts on what code to use and how? I am using VB Studio 2005 for this!
0
Comment
Question by:cclausen1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 8

Expert Comment

by:Yiogi
ID: 21827222
are you using nested drop downs and the next one depends on the value of the previous ones? That's what I understand. And even though you ask for VB code I hate to tell you that the best way (and the only way I know) is via Javascript.

Here is an example of a nested combo whose values change once you select something to the next option you should select:
http://www.javascriptkit.com/script/script2/2levelcombo.shtml

Here is an example of multiple combo boxes where the values of the next combo that gets enabled depend on the values of the previous. Basically its simple filtering of the data.
http://www.javascriptkit.com/script/script2/multiplecombo.shtml
0
 

Author Comment

by:cclausen1
ID: 21831110
Javascript should be fine but I am actually looking for something which will let me select more than one record from the same table.

Example:

Table A has different records like IN, IL, CA, MA, AZ etc.. If the user selects IL and then he also want to select IN, what would be the best way to approach it?
0
 
LVL 8

Accepted Solution

by:
Yiogi earned 750 total points
ID: 21834182
You can do it with either of the ways above. You could have combos with all the states and then filter out the ones the user selects so he/she cannot choose the same thing again. To be honest javascript is the only way I know with which you can do that.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.
Suggested Courses

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question