Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / July 2007

Tip: Looking for answers? Try searching our database.

Need to put multiple columns of a combo box into controls

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
rheath - 17 Jul 2007 08:14 GMT
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.
Ofer Cohen - 17 Jul 2007 12:08 GMT
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)

Signature

Good Luck
BS"D

> I have a combo box with 3 columns and want all 3 columns to be source for 3
> different controls on the form.  
[quoted text clipped - 4 lines]
> confirmation of what was chosen.  And all three must pass to the subform,
> which needs them as controls.
rheath - 17 Jul 2007 23:58 GMT
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

> In TextBoxes that located on the same form as the combo, you can display the
> other columns by writing in each text box ControlSource
[quoted text clipped - 17 lines]
> > confirmation of what was chosen.  And all three must pass to the subform,
> > which needs them as controls.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.