unbound combo box and field

  • Thread starter Thread starter Sergey Bogdanov
  • Start date Start date
S

Sergey Bogdanov

Hello,

I have the form where are located an unbound combobox and text field.
Combobox record source contains "SELECT ... FROM table1 ORDER BY ...".
When user choose one of value from this combobox, the text field must
contain value from table2 which field equal to one of field in table1
(one-to-one relation).

Is it possible to retrieve the table2 field value for text field without
involving "VB Scripts".

Thnx,
Sergey
 
Hello Sergey

I would suggest that you include the field from Table2 in the rowsource of
your combo box. Increase the combo's column count by 1 but set the new
columns width to 0. Then in the AfterUpdate event of the combobox add the
following code;

Me.tbTextboxname = Me.cbComboname.Column(x)

where x in the column number -1 of the new column

HTH

Andy
 
Thank you It really helped me.

Andy Cole said:
Hello Sergey

I would suggest that you include the field from Table2 in the rowsource of
your combo box. Increase the combo's column count by 1 but set the new
columns width to 0. Then in the AfterUpdate event of the combobox add the
following code;

Me.tbTextboxname = Me.cbComboname.Column(x)

where x in the column number -1 of the new column

HTH

Andy
 
Back
Top