473,405 Members | 2,310 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Populate ComboBox based on selection of another ComboxBox

ROO
Hi Everyone,
I have a database table that have 4 field( C1, C2,
M1, M2) on my form i have two combo box ComboC and ComboM

C1 C2 M1
M2
1 Sales 1
Monthly Terms
1 Sales 2
Annual Terms
1 Sales 3
Yearly Terms
2 Tech 1
Windows
2 Tech 2
Linux
2 Tech 3
Mac

I write a procedure that populate ComboC with a Combine distinct info from
the table(C1 ' ' + ' ' + C2) and When you Select any item from ComboC it
populates ComboM with the List of item in (M1 ' ' + ' ' + M2) in other words
if you select Sales in ComboC it should populate ComboM with Monthly Teems,
Annual Terms and Year Terms

It have the code that populate the comboxC below, I need help with the
procedure that will populate ComboM based on selection of comboxC

Dim mySqlConnection As SqlConnection
mySqlConnection = New
SqlConnection(System.Configuration.ConfigurationSe ttings.AppSettings.Get("Co
nnectionString"))
mySqlConnection.Open()
Dim Dt As DataTable
Dim Ds As New DataSet
Dim StrSql As String
StrSql = "SELECT Distinct ClientNumber + ' ' + ' ' + ClientName as
MyClients, ClientNumber as ClientID FROM ClientMatter"
Dim Da As New SqlDataAdapter(StrSql, mySqlConnection)
Da.Fill(Ds)
_dtClient = Ds.Tables(0)
Try
cmbClient.ValueMember = "ClientID"
cmbClient.DisplayMember = "MyClients"
cmbClient.DataSource = _dtClient.DefaultView
Catch ex As Exception
MsgBox(ex.Message.ToString)
End Try
mySqlConnection.Close()

Thanks
ROO
Nov 21 '05 #1
0 2116

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Steve | last post by:
I have a continuous form with several unbound comboboxes in the form header. The comboboxes are used to provide criteria for the SQL of the form. The code behind the form looks like: Public Sub...
2
by: ross kerr | last post by:
Hi all, I have a control that extends the ComboBox object. It updates the selected item based on what the user enters in the text area. In the OnLeave event of the combobox, the selected...
3
by: Alonso | last post by:
Hi, I have two drop downs and the content of the second one must changed everytime the user changes the selection in the first one. Is any easy way of doing this? Thanks in advance. Alonso
14
by: Barney | last post by:
How can I populate a textbox from a dataview? I have a dataset i'm filtering on and i want to populate several textboxes based on that filter. How can i get that to work? I've tried: ...
0
by: SimpDogg | last post by:
Hey guys another Newbie here... I have a combobox(JobName) on my form tied to a table named (Jobs) with one field for all of the jobs in the comboxbox. I want to auto populate the Due Out Date...
2
by: Ronald | last post by:
I hope somebody can help. I can't get into the specifics of my project, but I'll try to create a simple example: tblVehicle * VIN (text box) * Make (text box) * Model (text box) frmRepair
3
rohitrohitrohit
by: rohitrohitrohit | last post by:
new to php..... i hav a login page? after validaing loginname and password second page comes...... i access his loginname through url which is ->http://localhost/aa/vtr/add/add_ps2.php?name=div,in...
1
by: =?Utf-8?B?Q2hyaXM=?= | last post by:
This actually stemmed from anther post I created. But, I have two combo boxes. ComboBox1 is populated by a list of Systems (DataSet from Oracle Query). Now, I want to take Combobox2, and when...
1
by: Rosie | last post by:
I have a main form with header info w/ 'tHeader' as the control source. I have a subform with 'tDetail' as a control source. They're strung together by a field named MA_ID. This works...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.