Solved

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

Posted on 2013-02-06
1
345 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
[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
1 Comment
 
LVL 74

Accepted Solution

by:
Jeffrey Coachman earned 300 total points
ID: 38861731
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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
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…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…

740 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