Need to put multiple columns of a combo box into controls

G

Guest

I have a combo box with 3 columns and want all 3 columns to be source for 3
different controls on the form.
Also a subform needs 2 controls from the mainform. I don't know VB well
enough to know what code I need to put to make it do this.
(If you want to refer to my specific example, I have ID, lastname, firstname
in combo. ID is the bound column, but I want to display the other two as a
confirmation of what was chosen. And all three must pass to the subform,
which needs them as controls.
 
G

Guest

In TextBoxes that located on the same form as the combo, you can display the
other columns by writing in each text box ControlSource

' for the second column in the combo write
=[ComboName].[Column](1)

Note: the column start with 0

If you want to display the value in a sub form, when the combo located in
the main form, then use

=[Parent]![ComboName].[Column](1)
 
G

Guest

Thanks so much for your speedy reply!
I was able to get the subform to use the fields fine which was the most
important part. But it didn't work for putting one of the subform combo
column values (not the bound value) into the subform itself (to be then put-
via controlsource- into the subform record.)

So,in the subform I have boundcontrol StudentLastName. The key to the
record in Student file is successfully visible on the form and being put into
the record. But the other field in the combo, LastName is bound to
EventLastName in the subform record. I put as it's defaultvalue
=[Combo20].[Column](0) to put the first combo field into this visible
control. This did not work. Do I need more identifying as to where this
combo20 is? Or am I trying something illegal?
(I know this is actually violating all rules of normalization but my
non-techie users, on of whom is my supervisor, who are think they are
semi-techie want to see the name along with the primary key id value in the
record itself. THen they can play around with it more easily. I know, I
know.....)
I appreciate your help with this.
Ruth

Ofer Cohen said:
In TextBoxes that located on the same form as the combo, you can display the
other columns by writing in each text box ControlSource

' for the second column in the combo write
=[ComboName].[Column](1)

Note: the column start with 0

If you want to display the value in a sub form, when the combo located in
the main form, then use

=[Parent]![ComboName].[Column](1)

--
Good Luck
BS"D


rheath said:
I have a combo box with 3 columns and want all 3 columns to be source for 3
different controls on the form.
Also a subform needs 2 controls from the mainform. I don't know VB well
enough to know what code I need to put to make it do this.
(If you want to refer to my specific example, I have ID, lastname, firstname
in combo. ID is the bound column, but I want to display the other two as a
confirmation of what was chosen. And all three must pass to the subform,
which needs them as controls.
 

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