Link to home
Start Free TrialLog in
Avatar of JP_TechGroup
JP_TechGroupFlag for United States of America

asked on

Access Combobox, Value result wrong

Please see the simple database I have included.
The combobox of the included form is unbound and has as its source a simple table with a column named c_name (sorted ascending) and the id column, bound to column 0.
The forms data source is a query based on the table. The querie's criteria is set to a tempvar which holds the comboboxe's column(1) value.
This updates the form with the name and address of the combobox selection. Simple enough.
However, look at the bottom field of the included form. It will show you the combobox value vs the combobox column 1 value...
and they are different! So
This cannot be! Can someone please explain how to fix this problem? I have tried decompiling to no effect.

I inherited a project which has a form directly linked to a table with several comboboxes set up in an identical fashion and they are updating the table with incorrect values. Thank you.
Database9.accdb
Avatar of JP_TechGroup
JP_TechGroup
Flag of United States of America image

ASKER

This has something to do with the bound column set to 0. Setting it 2 resolves the issue in this context.
ASKER CERTIFIED SOLUTION
Avatar of PatHartman
PatHartman
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Yes, I actually left the column order as it was and made the bound column 2.
I then set the column count to 1, same result.
Sometimes you can get away with doing things like lying about the column count.  Other times you get bit.  Best to stick to standard methods and avoid potential issues and the confusion you cause people who must work on the app after yourself.  Good practice is "good" for a reason.
Agreed. Thanks