VBA - MS Access

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a combobox (cboCompany) and when a user selects a value from
cboCompany I want it to display in a textbox (txtSearch). I am not sure
about how to this in VBA/Access.
 
One option, write in the ControlSource of the txtSearch text box

=[cboCompany].column(1)

Or, second option, use the AfterUpdate event of the Combo and write the code
Me.txtSearch = Me.cboCompany.column(1)

Note: The column number start with 0, so the number depend on the column
number in the RowSource of the combo
 
Thanks, worked like a charm. Man its been years since I have worked with
VBA, thanks

Ofer Cohen said:
One option, write in the ControlSource of the txtSearch text box

=[cboCompany].column(1)

Or, second option, use the AfterUpdate event of the Combo and write the code
Me.txtSearch = Me.cboCompany.column(1)

Note: The column number start with 0, so the number depend on the column
number in the RowSource of the combo


--
Good Luck
BS"D


junior said:
I have a combobox (cboCompany) and when a user selects a value from
cboCompany I want it to display in a textbox (txtSearch). I am not sure
about how to this in VBA/Access.
 
Back
Top