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

Combobox value is wrong

P: n/a
Hello all,
On my form I have an unbound combobox based on a query displaying two rows.
The rows are : 1) Zipcode (Leftmost (In the query this field is sorted
ascending
2 City

The BoundColumn property is set to 2, because the value of Citymust appear
in another control
When selecting a unique zipcode there is no problem, it does what is
expected but ...

Now lets' say that I have displayed :

2030 Zottegem
2040 Antwerpen
2040 Berendrecht
2040 Lillo

When clicking on any 2040 value it will always give Antwerpen as its value,
obviously the first in the alabetic order. What is it that I am doing wrong
?
Any help appreciated ... thanks
Ronny


Nov 12 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
You don't need to bind the 2nd column to get its value to appear in another control. It is
true that the value of the combo box is based on the bound column, but you can get the
value from any column using the .Column property instead of the .Value property. So, if
you bind to the first column and want the value of the 2nd displayed in a textbox you
could use something like

=Me.cboMyCombobox.Column(1)

Yes, use 1 to get the value from the 2nd column. The index is zero based.

--
Wayne Morgan
"Ronny Sigo" <ro********@skynet.be> wrote in message
news:3f***********************@reader2.news.skynet .be...
Hello all,
On my form I have an unbound combobox based on a query displaying two rows.
The rows are : 1) Zipcode (Leftmost (In the query this field is sorted
ascending
2 City

The BoundColumn property is set to 2, because the value of Citymust appear
in another control
When selecting a unique zipcode there is no problem, it does what is
expected but ...

Now lets' say that I have displayed :

2030 Zottegem
2040 Antwerpen
2040 Berendrecht
2040 Lillo

When clicking on any 2040 value it will always give Antwerpen as its value,
obviously the first in the alabetic order. What is it that I am doing wrong
?
Any help appreciated ... thanks
Ronny

Nov 12 '05 #2

P: n/a
> Now lets' say that I have displayed :

2030 Zottegem
2040 Antwerpen
2040 Berendrecht
2040 Lillo

When clicking on any 2040 value it will always give Antwerpen as its value,
obviously the first in the alabetic order. What is it that I am doing wrong


The combo box is behaving normally. When a value is selected, it will always
fall back to the first instance of the bound column's value. It would appear
that you must either create a unique record identifier for each entry (bound
column - the value you would store) in the list, or you must store the city in
another field (the zip code control could be a typed-in value in a textbox or a
combo box listing distinct zipcodes and the city combo could display a filtered
list of cities, filtered on that zipcode field's value).

--
Bruce M. Thompson
bt******@mvps.org (See the Access FAQ at http://www.mvps.org/access)
NO Email Please. Keep all communications

within the newsgroups so that all might benefit.<<
Nov 12 '05 #3

P: n/a
Thanks guys !
"Wayne Morgan" <co***************************@hotmail.com> schreef in
bericht news:GI*****************@newssvr32.news.prodigy.co m...
You don't need to bind the 2nd column to get its value to appear in another control. It is true that the value of the combo box is based on the bound column, but you can get the value from any column using the .Column property instead of the .Value property. So, if you bind to the first column and want the value of the 2nd displayed in a textbox you could use something like

=Me.cboMyCombobox.Column(1)

Yes, use 1 to get the value from the 2nd column. The index is zero based.

--
Wayne Morgan
"Ronny Sigo" <ro********@skynet.be> wrote in message
news:3f***********************@reader2.news.skynet .be...
Hello all,
On my form I have an unbound combobox based on a query displaying two rows. The rows are : 1) Zipcode (Leftmost (In the query this field is sorted ascending
2 City

The BoundColumn property is set to 2, because the value of Citymust appear in another control
When selecting a unique zipcode there is no problem, it does what is
expected but ...

Now lets' say that I have displayed :

2030 Zottegem
2040 Antwerpen
2040 Berendrecht
2040 Lillo

When clicking on any 2040 value it will always give Antwerpen as its value, obviously the first in the alabetic order. What is it that I am doing wrong ?
Any help appreciated ... thanks
Ronny


Nov 12 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.