?
Solved

Populate 2nd combobox based on selction on 1st combo box

Posted on 2011-05-03
2
Medium Priority
?
651 Views
Last Modified: 2013-11-12
Hi,
Advance thanks. I am using 2 comboboxes. Each comboxes comb1, comb2 is already populated with values. Comb1 has A,B,C,D,E. Comb2 has 1,2,3,4,5,6,7,8,9.
If i select "A" from comb1 , should display "5","6", "9" in comb2
If i select "B" from comb2, should display "1","2","6"
etc...
Can you help me the best way to do this.

Kind regards,
Pooja
0
Comment
Question by:poojasureshkumar
2 Comments
 
LVL 83

Assisted Solution

by:CodeCruiser
CodeCruiser earned 400 total points
ID: 35517436
0
 
LVL 1

Accepted Solution

by:
HumbleBeginnings earned 1600 total points
ID: 35569935
Hi Pooja,

If I understand you correctly, adding the following two subs along with any additional "Case" lines you need should do the job...

	Private Sub Comb1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Comb1.SelectedIndexChanged
		Select Case Comb1.SelectedItem
			Case "A"
				AssignComb2Values({5, 6, 9})
			Case "B"
				AssignComb2Values({1, 2, 6})
		End Select
	End Sub

	Private Sub AssignComb2Values(ByVal vals())
		Comb2.Items.Clear()
		Comb2.Items.AddRange(vals)
	End Sub

Open in new window


Hope this helps!

Humble Beginnings :)
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

Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…

749 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