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

Dropdownlist creates content in another dropdownlist

Status
Not open for further replies.

ola123

Technical User
Sep 16, 2005
52
JM
yup i suck..

How would you go about creating a dropdownlist that whenever an option is selected from it, it creates the contents for another Dropdownlist?

Thanks in advance

B2DB
**Cool Nuh Man**

 
you would have to fire an event on the SelectedIndexChanged of the first dropdown and pass some parameter to a sub (or hardcode if blocks) to fill the second list.

One possible work around, if they are static, is to create ENUMS out of your values, when you select something from combo A simply change the Enum that you are "hooked up"
to for combo B.

-The answer to your problem may not be the answer to your question.
 
understand what you are saying (except for ENUMS what's that)

and an example of a script doing that would be nice..

Oh i'm a beginner by the way.....
 
Enum = Enumeration
Enumeration = Text with numeric Values (for comparing)

There should be a recent post (because i answered it) about combo boxes with value display text) it has an example about binding an Enumeration to a drop down list.

Example Code:
Code:
Enum Grades
A = 100
B = 89
C = 79
D = 69
F = 64
End Enum

Sub GetGradeLetter(intGrade) as string
  Select Case True
   Case intGrade > Grades.A
     Return "Cheater"
   Case intGrade > Grades.B
     Return "A"
   Case intGrade > Grades.C
     Return "B"
   Case intGrade > Grades.D
     Return "C"
   Case intGrade > Grades.F
     Return "D"
   Case Else
     Return "Loser" 'Do not let this get into production
  End Select
End Sub



-The answer to your problem may not be the answer to your question.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top