Solved

Display the second field in a combo box after a selection is made

Posted on 2013-02-06
1
340 Views
Last Modified: 2013-02-06
I have a table that has CustomerNumber as the first field and CustomerName as the second field.

The invoice form has a combo box where the user can enter the customer number. We want the customer number to be displayed in this field. But when the user clicks the drop-down arrow for the combo box, we want the user to be able to type a customer name and have it jump to that customer name as they type. Once they have made a selection, we want the customer number to be displayed in the combo box.

Is there a way to do this? If I make the first visible column in the combo box the customer name, the drop-down typing works fine but the customer name is displayed in the field once a selection is made. If I make the first visible column the customer number, the typing in the drop-down goes by customer number instead of name.

Thanks in advance.
0
Comment
Question by:jrmcanada2
1 Comment
 
LVL 74

Accepted Solution

by:
Jeffrey Coachman earned 300 total points
Comment Utility
No can do...

A combobox can only display the value from one Field.

You can, however, display any column from the combobox in a textbox on the form.

Code roughly like this on the afterupdate event of the combobox:

Me.txtCustID=me.YouCombo.Column(0)
(this presumes that the first column in the combobox is the CustID)
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

763 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now