473,725 Members | 2,173 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Using the value of comboBox1 to populate comboBox2

1 New Member
Hi, I am fairly new to VB and I am using Visual Studio 2005. I am currently trying to make a simple programme to search a database using 2 different combo boxes to define the search parameters. The database is a list of car manafacturers, models and information about tow bar's (part number etc..). I want the first combo box to be populated with the manafacturer names and that selection to populate the second combo box with the relevant car model. I am sure the solution to this is simple but I have spent 2 days trying to figure it out. I apologise for my vagueness. Let me know what, if any, extra info will help.

Thanks in advance.
Apr 10 '08 #1
1 1457
jeffstl
432 Recognized Expert Contributor
Have you had success in populating your first combo box by binding it to a recordset or another method?

If so then your next step is to use the OnChange event of that combobox1 to fire off the code that will populate combobox2, you would just do it the exact way you populate combobox1 except use the combobox1.Text value as your parameter in your datasource.
Apr 10 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1318
by: Grant | last post by:
Hello, What do I do with a combo box if I have a null value? I have two tables linked in an access database - Table1 contains a column called "state" (integer) which is linked to Table2 which contains a list of states and their id's. The problem is some records in Table1 dont have a state so the database is returning a Null value. The error I get: 'Cannot get value because it is DBNull.'
7
20767
by: charliewest | last post by:
Using .Net CF, i have created a 2 dimension ArrayList, and "binded" this list to a ComboBox control using the "DataSource" property. I have set the DisplaySource and ValueMember properties as well. The control populates well, both the display values, and selected values. However, when i try to "set" the SelectedValue or SelectedIndex properties, nothing happens.... The default blank value in the ComboBox is always selected. My code is: ...
2
40529
by: Keith | last post by:
I have populated (or created a collection) in a ComboBox. However - I would like to set a default value - when my form is first opened (for the ComboBox) - like "Select topic" However - when I attempt to add this text to the Text property of the Combobox - it does not take. In other words, I type it in the property - but when I leave the field - it is blank. I also tried modifying the ComboBox control - in the following manner 'ComboBox...
10
5041
by: Rick Palmer | last post by:
I have an app I'm working on that will allow a user to run one of 5 reports. The report names are in a combobox on my form. I have a sub defined for each report that has the exact same name as is displayed in the combobox. I have one button on the form to start processing. What I want to do is this: When the user selects the report they want to run from the combobox, I want to dynamically bind the appropriate sub to the button's click...
1
1857
by: Frustrated Developer via DotNetMonster.com | last post by:
I have developed a form that would allow the user to load and search a database several ways, by data range using two combo boxes, by specific number entered in a text box or all database entries. I'm able to use the combo box selection method multiple times with no problem However, when I try to type in a specific drawing number in the txtDrawingNum.text field and click btnLoad I get the same dataset that I previously had from the combo...
3
1617
by: mustafa shahid | last post by:
i've problem that I've 2 combobox , in which 1 combobox (Combox_Pos) have 2 items and 2nd combobox (CBox_KnitStyle) have no.of items Private Sub Form_app_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'combobox of POSITION Combox_Pos.Items.Add("Active") Combox_Pos.Items.Add("Inactive")
6
5645
by: Aussie Rules | last post by:
Hi, I have a datepicker that show a calender. The user picks a date and the time component is always 00:00. I then have a drop down that provides a list of times, (10:00, 11:00 etc), and I want to combine this with the date value, so that I can store it in a single field in the database. How can I combine these two values into one ?
0
1699
by: wisaunders | last post by:
the file I'm importing has > 200,000 records I have one problem: One of the columns in the .txt file (customerID) has almost all Inetger values except for about 30 records. Those 30 records have one letter in the customerID field (M123456). The field they are going into is VARCHAR(1000) . All of the integers go in correctly but for some reason the cutomerID values that stert with a letter (M123456) are NULL. Any help? I'm stumped. ...
3
8748
by: PowerLifter1450 | last post by:
Hi all, I have to Combo boxes on a form. The first one I would always like users to see. The second, however, I would like hidden if the first box has certain values selected. So, if ComboBox1 has values of 1 or 2, I would like ComboBox2 to show as normal. If ComboBox1 has a value of 3, I would like ComboBox2 hidden. Is there a relatively simple way of doing this, if at all? Thanks for your help as always! --Eric
0
8752
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9257
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9113
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8097
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6011
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4519
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4784
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3221
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2635
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.