Combo Box

  • Thread starter Thread starter Tim
  • Start date Start date
T

Tim

Hi

Is there a way, i can do the following.

I would like to select a field in a combox and then
related field in the child table would display on the
same form.

Say if i select ID number 1. Then on another field Green
would appear.

Primary Child
ID Name ID COlor PrimaryID
1 Primary 1 Green 1

I have already tried ,
http://support.microsoft.com/default.aspx?scid=kb;en-
us;209537 but wouldn't help.
 
Tim,
In the query behind your combo box, add and relate the Child table to
your Primary, and place the Child Color field in the query to create a 2
column combo display.
Place a Text control on your form with a RecordSource of... (use your own
names)
= MyCombo.Column(1)
When you select a Primary ID in the combo, the text control will display
the appropriate, related, color from the child table. (**Combo columns are
number 0, 1, 2, etc...)
No need to "save" the child value on your form... you only have to
"display" it. Since you capture the PrimaryID via the combobox, you can
always re-display the associated child color on any subsequent form, query,
report....
hth
Al Camp
 
Tim

If "Green" is the second field in your combo box, and if you have an unbound
text control, the following (untested aircode) should do what you asked:

Me!txtColorName = Me!cboComboBox.Column(1)

Put this in the AfterUpdate event of the combo box, so that every time you
pick a different row in the combo box, the text box value is set. (note
that .Column() is zero-based)
 
Back
Top