473,495 Members | 2,058 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Help - Problem with 2 combo boxes populated from same data

Greetings,

I have a form with two comboboxes that I want to be populated with the
same values from a table (i.e. both comboboxes have the same
table/column as their datasource and display member).

The selections made from these comboboses are to be saved in two
different columns in another table.

For example, the possible selections could be from the "Description"
column of table a but the selection made from combobox1 would be bound
to the id1 column of table b and the selection made from combobox2
would be bound to the id2 column of table b.

The problem I am having is that any selection made in one combobox is
immediately reflected in the second one. They are staying synchronized
so they both show the same selection.

How can I achieve my desired results?

I thought that by each combobox control having a different
selectedvalue or valuemember property value they would behave
independently.

Any help will be greatly appreciated,

Greg.
Nov 15 '05 #1
2 1916
Hi,

when you bind a control to a datasource (or any other list of objects) a
CurrencyManager
is created to track the current row (or object). Every change of selection
is communicated
to the currency manager, which in turn notifies any other control bound to
the dataset.
So, selection changed in one control is immediately reflected in the other
controls.
Nothing (I guess) you can do about it.
To work around, you could create a second identical dataset (or whatever
list you are using)
and bind this one to the second combobox.
Tip: also wait for other people to reply.

Greetings,

Bram.
"Greg Bradburn" <gb*******@nc.rr.com> wrote in message
news:9b*************************@posting.google.co m...
Greetings,

I have a form with two comboboxes that I want to be populated with the
same values from a table (i.e. both comboboxes have the same
table/column as their datasource and display member).

The selections made from these comboboses are to be saved in two
different columns in another table.

For example, the possible selections could be from the "Description"
column of table a but the selection made from combobox1 would be bound
to the id1 column of table b and the selection made from combobox2
would be bound to the id2 column of table b.

The problem I am having is that any selection made in one combobox is
immediately reflected in the second one. They are staying synchronized
so they both show the same selection.

How can I achieve my desired results?

I thought that by each combobox control having a different
selectedvalue or valuemember property value they would behave
independently.

Any help will be greatly appreciated,

Greg.

Nov 15 '05 #2
Thanks Bran, that's pretty much the conclusion I've come to as well.

"Bram" <bv****@skynet.be> wrote in message news:<40*********************@news.skynet.be>...
Hi,

when you bind a control to a datasource (or any other list of objects) a
CurrencyManager
is created to track the current row (or object). Every change of selection
is communicated
to the currency manager, which in turn notifies any other control bound to
the dataset.
So, selection changed in one control is immediately reflected in the other
controls.
Nothing (I guess) you can do about it.
To work around, you could create a second identical dataset (or whatever
list you are using)
and bind this one to the second combobox.
Tip: also wait for other people to reply.

Greetings,

Bram.

<snip>
Nov 15 '05 #3

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

Similar topics

0
1657
by: Joyce | last post by:
The XML Schema design problem to solve is as follows: We have 2 combo boxes to populate from schema data, let's say: 1. States 2. Cities (and this one gets populated depending on the choice of...
1
1581
by: Dalan | last post by:
Sometime ago I had inserted two Combo Boxes on a form (cboCustomers) and (cboVendors) to lookup values in separate tables. They have worked fine except now I want to increase their usage by...
14
5310
by: Gary Shell | last post by:
I have five comboboxes each has a item listed populated by hand in the IDE. Each has the text property bound to a text field in the database. When I initially fill the dataset and display the page...
4
4600
by: jon f kaminsky | last post by:
Hi- I've seen this problem discussed a jillion times but I cannot seem to implement any advice that makes it work. I am porting a large project from VB6 to .NET. The issue is using the combo box...
3
8227
by: rlm | last post by:
This small problem to solve involves a two table database (one parent and one child table), one winform and two combo boxes. Combo box A is populated in the Load event. Combo box A pulls data...
1
1305
by: robtyketto | last post by:
I have Three combo boxes that ideally I want the the users to access in the correct sequence as they depend on the value within the combo box before them. #1 Facility #2 Area #3 Sport ...
4
3508
by: SKelso | last post by:
I created a database in Access 2003 that contains an unbound search form with several combo boxes. Each combo box is populated with entries from the appropriate table. I want to allow the user to...
4
2391
by: dougmeece | last post by:
Morning Everyone... I have a table that needs to be append to and also updated. All the fields in the table are populated with data from the text boxes and combo boxes on a form. The Date...
0
2895
by: Del | last post by:
Hello and thanks for any and all assistance! I have a database that is used by several users on several different machines. The backend database is housed on a file server. Each user has a...
0
7120
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,...
0
6991
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
7160
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7196
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...
1
6878
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...
0
7373
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
3088
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...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1405
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 ...

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.