unbound combo box and field

  • Thread starter Sergey Bogdanov
  • 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
 
A

Andy Cole

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
 
S

Sergey Bogdanov

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top