473,668 Members | 2,661 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

All comboboxes automatically changing when user changes only one ???

Hi,

I have a strange question... I have a series of combo boxes being
populated by the same dataset, and I've noticed if one is changed then
all change as well. I'm using Visual Basic 2005 and writing a Winform
app, and below is how I'm binding the dataset to the combobox object:

cbTotalCurrency .DataSource = CurrencyDataset .Tables(0)
cbTotalCurrency .DisplayMember = "CurrencyNa me"
cbTotalCurrency .ValueMember = "CurrencyID "

I have about 5 comboboxes using this same dataset and if I change any
of the dropdowns in the application when running, all 5 change to
whichever one I selected.

Other than creating 5 different datasets, is there anyway around
this? I want the user to be able to select a different item in each
combobox.

Thanks --

Alex
Jul 21 '08 #1
1 3677
Alex,

One way to make the comboboxes independent of each other is to assign each
combobox a new binding context. For example:

cbTotalCurrency .BindingContext = New BindingContext
cbTotalCurrency .DataSource = CurrencyDataset .Tables(0)
cbTotalCurrency .DisplayMember = "CurrencyNa me"
cbTotalCurrency .ValueMember = "CurrencyID "

Do that for each of the comboboxes and then they should be independent.

Kerry Moorman

"Alex" wrote:
Hi,

I have a strange question... I have a series of combo boxes being
populated by the same dataset, and I've noticed if one is changed then
all change as well. I'm using Visual Basic 2005 and writing a Winform
app, and below is how I'm binding the dataset to the combobox object:

cbTotalCurrency .DataSource = CurrencyDataset .Tables(0)
cbTotalCurrency .DisplayMember = "CurrencyNa me"
cbTotalCurrency .ValueMember = "CurrencyID "

I have about 5 comboboxes using this same dataset and if I change any
of the dropdowns in the application when running, all 5 change to
whichever one I selected.

Other than creating 5 different datasets, is there anyway around
this? I want the user to be able to select a different item in each
combobox.

Thanks --

Alex
Jul 21 '08 #2

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

Similar topics

4
1965
by: Kathy | last post by:
In my custom menu one menu item opens a form to add new Makes to TblMakes and another menu item opens a form to add new Models to TblModels. I have a form that has a combobox for Makes and a combobox for Models. In both comboboxes I use the NotInList event and code to allow users to enter Makes and Models that are not in the database. When the form is open, I want to limit the users to entering new Makes and Models in the comboboxes and not...
4
2960
by: Jazper Manto | last post by:
hi i bounded the same dataview to 2 different comboboxes. now, when i change the selectedIndex of combobox1, it automatically changes the selectedIndex of combobox2. does this mean, that the combobox selects the item on the base of some kind of a pointer on the dataview? if yes, is there a class inside the framework, which i can use to change this pointer on the dataview myself? thanx for any hint.
5
1935
by: Phil | last post by:
Hi all I'm new to vb but have a little experience in vba im using vb.net my question is with comboboxes the fist combo box lists the manufactures when a selection is made the second combox populates with the available products and when a selection is made here then next combobox will be populated with model numbers and so on can someone point me in the direction for this information and also does information get stored in a data base or...
1
2469
by: lgbjr | last post by:
Hi All, I need some advice. I have a table in MSDE2000 with about 3 million records. It's a city database. What I want to do is have 3 comboboxes on a form. The first would be to select a country, second, to select a region (state, province, etc) in that country, and the third would be a list of cities in the selected region. I don't want 3 million records in my dataset, but I can't figure out how to set things up so that I'm only...
30
3384
by: Charles Law | last post by:
Here's one that should probably have the sub-heading "I'm sure I asked this once before, but ...". Two users are both looking at the same data, from a database. One user changes the data and commits it. How does the other user get the updated view without polling for changes? Is there some sort of callback mechanism that can be set up on the dataset or connection? TIA
2
11448
by: Matt | last post by:
Hi all, me again! :) I've now got an issue with combo boxes. Basically, I have a number of items that I want a user to pick from a single list. It's basically along the lines of: Fruit 1: Fruit 2: Fruit 3:
3
1866
by: Randy | last post by:
I have a routine that creates a series of comboboxes, each of which is bound to a common dataview. Everything used to work fine, but now, when I change the value of any of the comboboxes, the value in ALL of the comboboxes changes to the new value. I have boiled down the code to the simplest lines and placed it on its own form, but I still get the same behavior. I have stepped through each line of code, and I don't see any other lines...
3
1780
by: BASSPU03 | last post by:
I had to present my DB today, but was granted a chance to fix something about it. In order to fix something, I added something...something that is giving me more trouble than it should. I have to present again tomorrow. Quick assistance would be greatly appreciated. I have three forms (one main form and two subforms) with the following fields: frmResultsFY FiscalYear sfrmResultsAgencies FiscalYear Agency
0
8462
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8381
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,...
1
8583
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8656
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
7401
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...
1
6209
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4205
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
4380
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2023
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.