473,320 Members | 1,861 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,320 software developers and data experts.

Combo box bindings

Hi,

Is it OK to bind a combo box to more than one datasource?
One is by:
Me.cboState.DataBindings.Add(New Binding("SelectedValue", Me.AddressRow,
"State"))

Another is by a DataView:
aView = New DataView(dsLookup.States)
With Me.cboState
.DataSource = aView
.DisplayMember = "Description"
.ValueMember = "StateAbbr"
End With

Look like it works. But sometimes the field gets empty when I click the
fields around. I steped in and couldn't find any codes doing that. So I
suspect it is a binding issue.

Please help.
Thanks in advance.

Li

Jul 21 '05 #1
5 1232
Hi Li,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need to know if we can add multiple
databindings to a ComboBox. If there is any misunderstanding, please feel
free to let me know.

Yes, we can add different bindings to different properties for a control.
But we can add only one binding for one property. Based on the code you
have provided, it is correct. However, I'm not quite sure what you mean by
"the field gets empty when I click the fields around". Could you explain it
a little bit more? Thanks!

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Jul 21 '05 #2
Hi, Kevin:

After debugging, I found out that after I input something in a text box or
make a selection from a combo box, I click other field. Now the form's
IsDisposed = True and causes all controls' IsDisposed = True. That causes the
fields empty, cursor stuck, etc. But after I click several times, the cursor
moves and everything is ok.

I know it looks weird. But do you have any suggestions about how this may
happen? The form is created as a dialog form.

Thanks.

Li
"Kevin Yu [MSFT]" wrote:
Hi Li,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need to know if we can add multiple
databindings to a ComboBox. If there is any misunderstanding, please feel
free to let me know.

Yes, we can add different bindings to different properties for a control.
But we can add only one binding for one property. Based on the code you
have provided, it is correct. However, I'm not quite sure what you mean by
"the field gets empty when I click the fields around". Could you explain it
a little bit more? Thanks!

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Jul 21 '05 #3
Hi Li,

This is weird. To make debugging simpler, could you send me a simple
project that can reproduce the problem? I can debug it on my machine and
work it out more quickly. Thank you.

Remove 'online' from the nospam alias is my email.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Jul 21 '05 #4
Hi, Kevin:

I couldn't create a sample from our project to reproduce the problem. I
dis-bind the fields to workaround the problem.
Now I have another problem but I will post as another thread to have the
Subject related to the issue.

Thanks.

Li

"Kevin Yu [MSFT]" wrote:
Hi Li,

This is weird. To make debugging simpler, could you send me a simple
project that can reproduce the problem? I can debug it on my machine and
work it out more quickly. Thank you.

Remove 'online' from the nospam alias is my email.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Jul 21 '05 #5
Nice to hear that you have found a workaround.

Thanks for sharing your experience with all the people here. If you have
any questions, please feel free to post them in the community.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Jul 21 '05 #6

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

Similar topics

0
by: Fernb2000 | last post by:
Hello I have a dataset is composed of a table that has a Name and Id colums. I would like to fill the combo box with the List of names from the dataset and I would like the text box to be the id...
1
by: FZ | last post by:
Hi Gang, I was wondering if a generous person might be able to walk me through what I believe is a pretty simple task. I actually have significant Access experience, but I haven't done it in...
0
by: James | last post by:
I have a bound combo using a lookup table which is behaving as expected with the exception of the first record. In the list of rows for my combo, the first is '.'. This is because of another...
6
by: Brian Henry | last post by:
Here's an example of the code.. I have two combo boxes on screen that when one's selection is change the other's items will be updated to reflect the change (based on a relation) Private...
10
by: Richard | last post by:
I have created a form which sets up a dataview. The form views one record at a time using a currencymanager. This works fine. All my text boxes bind. However I have a combo box which gets its...
5
by: Li Weng | last post by:
Hi, Is it OK to bind a combo box to more than one datasource? One is by: Me.cboState.DataBindings.Add(New Binding("SelectedValue", Me.AddressRow, "State")) Another is by a DataView: aView =...
3
by: Bill | last post by:
I have what I think should be a simple question regarding a bound combo box. My first table is Dealers: DealerID - primary key DealerName BillToLocation My second table is Locations:...
1
by: =?Utf-8?B?UmVkYmFjaw==?= | last post by:
Hi All, slight problem I hope someone could shed some light on. I am using VS 2005. In a datagridview I have 2 comboboxes that are both bound to a table field called "empCode". This is an...
3
by: jaymaelescent | last post by:
I have been asked by worklace to try and make a database for them, i have some experience but have encountered a problem making user specific reports. I need to make a report based on a person stored...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.