Using a combo box to populate two cells

brocsman

Registered User.
Local time
Today, 19:38
Joined
Nov 21, 2010
Messages
28
I'm designing a form to gather data including two names for each item. The two names are listed in a query, and I want to display the value in the first column to allow the user to select the correct value, then to use the values in both the first and second columns to populate fields in the new database record the form is generating.

I can see how to do it with just one column, but I can't see how to get it to populate both. Do I need to write a bit of code,or is there an easier way?
 
1. You should be storing the ID and not the text of the name.

2. you can DISPLAY the name by setting the query for the rowsource to be something like this:
Code:
SELECT PersonID, LastName & ", " & FirstName As PersonName 
FROM YourTableName
Don't use NAME as an alias because that is an Access Reserved Word.

Then you set the combo's column count to 2 and the column widths to 0";2" and the bound column should be 1.
 

Users who are viewing this thread

Back
Top Bottom