Solved

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

Posted on 2013-02-06
1
342 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
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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Suggested Solutions

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Familiarize people with the process of utilizing SQL Server stored procedures 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 Micr…
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…

831 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