By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,061 Members | 1,539 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,061 IT Pros & Developers. It's quick & easy.

currencymanager.position doesn't change

P: n/a
I have a dataset containing 2 tables. A is the master table, B is a lookup
table. There is a combobox bound to B, which updates a value in a FK field
in A.

my currencymanager is created thus:
cmB= CType(frm.BindingContext(DsClient1.Tables("B")), CurrencyManager)

The cbx has these settings:
cbx.valuemember=b.primarykey
cbx.displaymember=b.name
cbx.datasource=dsclient1
cbx.(databindings).selecteditem=b.primarykey
cbx.(databindings).selectedvalue=a.foreignkey
cbx.(databindings).text=b.name

When I change the value in the combobox, cmClientMaster.position does not
change.

Any suggestions?

Jeremy

Nov 21 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a

You show us you assinging cmB being assinged a Binding Context.. yet you
talk about cmClientMaster.

Same thing? or perhaps a typo? or just something you missed. =)

-CJ
"Jeremy" <je****@ninprodata.com> wrote in message
news:Ox*************@TK2MSFTNGP10.phx.gbl...
I have a dataset containing 2 tables. A is the master table, B is a lookup
table. There is a combobox bound to B, which updates a value in a FK field in A.

my currencymanager is created thus:
cmB= CType(frm.BindingContext(DsClient1.Tables("B")), CurrencyManager)

The cbx has these settings:
cbx.valuemember=b.primarykey
cbx.displaymember=b.name
cbx.datasource=dsclient1
cbx.(databindings).selecteditem=b.primarykey
cbx.(databindings).selectedvalue=a.foreignkey
cbx.(databindings).text=b.name

When I change the value in the combobox, cmClientMaster.position does not
change.

Any suggestions?

Jeremy

Nov 21 '05 #2

P: n/a
CJ, it's the same thing. Any ideas on cause & cure?

Jeremy

"CJ Taylor" <[cege] at [tavayn] dit commmmm> wrote in message
news:eV**************@tk2msftngp13.phx.gbl...

You show us you assinging cmB being assinged a Binding Context.. yet you
talk about cmClientMaster.

Same thing? or perhaps a typo? or just something you missed. =)

-CJ

Nov 21 '05 #3

P: n/a
Alright... lets try a couple things.

First.. get rid of this crap
cbx.(databindings).selecteditem=b.primarykey
cbx.(databindings).selectedvalue=a.foreignkey
cbx.(databindings).text=b.name
second..

just use

cbx.selectedvalue = a.foreignkey

third...

if all that doesnt work.. define your currency manager as

cmB = Ctype(BindingContext(dsClient1, "B"), CurrencyManager)

that should respond when the value changes in the lookup box (combo box).
your master has to respond differently.. try this and we'll get to more
later.

by the way, what is the frm.Bindingcontext? Self reference? or are you
doing this outside of the scope of your form (the manager resides in a
different class than the form itself.)

-CJ


my currencymanager is created thus:
cmB= CType(frm.BindingContext(DsClient1.Tables("B")), CurrencyManager)

The cbx has these settings:
cbx.valuemember=b.primarykey
cbx.displaymember=b.name
cbx.datasource=dsclient1
>

When I change the value in the combobox, cmClientMaster.position does not
change.

Any suggestions?

Jeremy

Nov 21 '05 #4

P: n/a
CJ, changing the currencymanager to

cmB = Ctype(BindingContext(dsClient1, "B"), CurrencyManager)

made the main difference.

I took out the (databindings) as you suggested, except for selectedvalue
(can't seem to find the cbx.selectedvalue property in the property
inspector).

frm is because the form is started with a shared method
(myform.Execute(sdasd,asdfasdf,asdfsf) that does a new on the form. It's an
mdi app.

Thanks, I greatly appreciate your help. Hopefully I'll figure out how to
find stuff like this in the dox someday.

Jeremy
"CJ Taylor" <[cege] at [tavayn] dit commmmm> wrote in message
news:eu**************@TK2MSFTNGP12.phx.gbl...
Alright... lets try a couple things.

First.. get rid of this crap
cbx.(databindings).selecteditem=b.primarykey
cbx.(databindings).selectedvalue=a.foreignkey
cbx.(databindings).text=b.name


second..

just use

cbx.selectedvalue = a.foreignkey

third...

if all that doesnt work.. define your currency manager as

cmB = Ctype(BindingContext(dsClient1, "B"), CurrencyManager)

that should respond when the value changes in the lookup box (combo box).
your master has to respond differently.. try this and we'll get to more
later.

by the way, what is the frm.Bindingcontext? Self reference? or are you
doing this outside of the scope of your form (the manager resides in a
different class than the form itself.)

-CJ


my currencymanager is created thus:
cmB= CType(frm.BindingContext(DsClient1.Tables("B")), CurrencyManager)
The cbx has these settings:
cbx.valuemember=b.primarykey
cbx.displaymember=b.name
cbx.datasource=dsclient1
>

When I change the value in the combobox, cmClientMaster.position does not change.

Any suggestions?

Jeremy


Nov 21 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.