TextBox = column(1)?

J

Joel

How do you get an unbound TextBox to display different columns from a ComboBox?

I have tried =[Forms]![Myform]![cbName].column(1)
and
.... ... ...!([cbName].column(1))

They both just end up saying #Name?

Can this even be done?

Thanks
 
A

Allen Browne

It should work with just:
=[cbName].[Column](1)

Note that Column() is a zero based property, so Column(1) is the 2nd column
of the combo.

Make sure the Name of this text box is not the same as the Name of any of
the fields in the form's RecordSource.
 
J

Joel

I didnt know you needed brackets around [column].

Thanks Again Allen

Allen Browne said:
It should work with just:
=[cbName].[Column](1)

Note that Column() is a zero based property, so Column(1) is the 2nd column
of the combo.

Make sure the Name of this text box is not the same as the Name of any of
the fields in the form's RecordSource.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Joel said:
How do you get an unbound TextBox to display different columns from a
ComboBox?

I have tried =[Forms]![Myform]![cbName].column(1)
and
... ... ...!([cbName].column(1))

They both just end up saying #Name?

Can this even be done?

Thanks
 
V

Van T. Dinh

I assume the ComboBox and the TextBox are on the same Form "MyForm".

The first one you posted is correct provided that you include the equal sign
in the ControlSource and the spellings are correct. Note also that the
index 1 actually means the second Column since index is zero-based.

The second one you posted is incorrect. You can try simply:

= [cboName].Column(1)

or

= [Form]![cboName].Column(1)
 
Top