Hi.
i have a form. that has a pull-down list of codes. these codes and descriptions are in a table. when i select a code, i like to populate a box that has the corresponding description for that code. how can i do this please?
thanks much.
the pulldown box select a code from a table. that table has these columns:
code description
aa advanced aeronautics
ac academic careers
i select the code aa
i like the box to have the description that corresponds to the code on the same row in this case - advanced aeronautics.
thanks.
it's not a combo box or list box that i'm trying to get a value in. it's a text box that needs to be populated.
the code is selected from a list box - no problem.
when it's selected, the text box should have the description that corresponds to the code. example:
code description
aa advanced aeronautics
ac applied civil engineering
listbox text box
aa should have advanced aeronautics populated.
PH's solution will take the value from the combo box's 3rd column and store it in a bound text box.
I typically never store the Description field in the table bound to the form since it is not standard practice. Based on the Row Source suggested by PH, I would set the text box control source to:
[tt][blue] =[combo21].[Column](2)[/blue][/tt]
This would display the description but not save it to the record source of the form.
still not working.
still getting the same error.
i didn't know this was going to be so complicated.
for combo21 i have this for row source:
SELECT ID, code, desc FROM Table1;
bound column = 3
for event procedure of combo21 i have:
Me![text28] = Me!combo21.Column(2)
text28 has no row source.
what should be in control source or data for text28?
I would remove the code entirely and set the control source of text28 to:
=combo21.Column(2)
Truthfully, I would change the name of combo21 to something that satisfies my naming conventions and standards. Perhaps "cboSomethingCode".
A couple other hints:
1) Desc as a name for anything is a bad word
2) field names like ID and Code are very generic and provide no information regarding the values they are storing. If ID is a primary key autonumber, I typically use a name that identifies the table like "EmployeeID" or "StudyAreaID".
3) #Name? might be caused by naming a control with the name of a field.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.