?
Solved

Displaying 2 columns once selected

Posted on 2011-02-25
9
Medium Priority
?
222 Views
Last Modified: 2012-06-27
Is it possible to display 2 columns when an item is selected?  

Right now, when you select from the list, only the last name will display at the top (not last | first - as the list itself does) - see screenshot.
ee-dropdown.jpg
0
Comment
Question by:gcgcit
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
9 Comments
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 34983167
No, not in the combobox.

You can do this with two textboxes with the controlsources set to the respective columns of the combobox:
cboName.Column(1)
cboName.Column(2)
Here the PK is the first Field which is Column(0)
LastName is the second column (cboName.Column(1))
FirstName is the third column (cboName.Column(2))
0
 
LVL 74

Accepted Solution

by:
Jeffrey Coachman earned 1500 total points
ID: 34983186
Or simply make the rowsource for the combobox a query the combines the First and Last Names:

Select NameID, LastName & ", " & FirstName AS FullName From YourTable

JeffCoachman
0
 

Author Comment

by:gcgcit
ID: 34983260
Do you have a sample database of this boag2000? I'm not quite clear on how to do this from above.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 34983350
the trick here is to superimposed an unbound textbox over the combo.

in the afterupdate event of the combo box, place this codes

Me.txtUnbound.SetFocus
Me.txtUnbound.Value = Me.cboName.Column(0) & " -  " & Me.cboName.Column(1)
0
 

Author Comment

by:gcgcit
ID: 34983364
so your interface will show a textbox that is "uneditable" and the combobox fills it?
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 34983488
Well I don't know the specific or your Data.

Remember that your question here requires that you have a basic understanding of how to set these properties...
Besides it is not clear what the combobox is doing after the Name is selected.

Give it a try on your own first before you decide that you can't do it..
Open the properties of the combobox and try building the SQL I posted.
Set the Rowsource as something like I posted above.
Then set the ColumnCount to: 2
Set the ColumnWidths to : 0,1

JeffCoachman
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 34983553
see this sample
Database41.mdb
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 34983646
<so your interface will show a textbox that is "uneditable" and the combobox fills it?>

Yes.
0
 

Author Closing Comment

by:gcgcit
ID: 34997438
Changed the query

Name: [tblPeople].[txtLastName] & ", " & [tblPeople].[txtFirstName] - changed column count from 3 to 2. Voila.  Idea from boag2000 came first and was what intiated this change (slight modification to what expert suggested).
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question