Monday 30 September 2013

textbox in continuous form populated from different table

textbox in continuous form populated from different table

I have a continuous form in an access 2010 database that outputs a
separate row of data for each customer from a customers_table. The
continuous form is for data display only, and no data entry or editing is
allowed. One of the textboxes on the continuous form is populated with
data that was entered using a combobox in a different form used for data
entry. In the textbox on the continuous form, enabled is set to no, and
locked is set to yes, so that the textbox is not editable in the
continuous form. However, in the separate data entry form, the combobox
entered the id for the selection the user chose, instead of entering the
text. Therefore, in the continuous form, only an id number is shown, when
the user needs to see the text of the specific option which is encoded in
that id number.
I think I want to keep the id in the customers data table, in order to
retain freedom to make subtle changes in the combobox options later.
So how do I modify the textbox in the continuous form to populate with the
textual value associated with the id number? This would seem to involve
some sort of SQL like:
"Select textValue FROM comboboxsource_table WHERE
comboboxsource_table.ID=textbox.Text"
However, I have no idea where to put this in the Access GUI. The Control
Source field in the Data tab of the property sheet for the textbox does
not seem to allow this sort of syntax.

No comments:

Post a Comment