combining two data sources into a combo box (1 Viewer)

penfold1992

Registered User.
Local time
Today, 13:21
Joined
Nov 22, 2012
Messages
169
I have a main form which requires users to fill in their ID number in order to create a new entry into the database.

ID numbers are stored in a table that has two columns:
ID Name

This is so that I can match up the ID to their name when they enter in a new entry. I currently have a normal drop down where you can select something from the "ID" column in the table however I wonder if there is a possibility to show the second column as well for a reference... ill give an example of what I would like the drop down box to look like

(ID) - (Name)
274 - John Doe
275 - Jane Doe
276 - Karl Brahms
277 - David Augsi
278 - Sandra Haston

when someone enters one of these, it enters just the ID number into the database entry, the name is just there aesteticly. Is this possible to do or too complicated?
 

mahenkj2

Registered User.
Local time
Today, 18:51
Joined
Apr 20, 2012
Messages
459
You want to see two columns in a combo, correct?

Set the Column count property to 1 (0 is first column) and set column width appropriately.
 

MStef

Registered User.
Local time
Today, 13:21
Joined
Oct 28, 2004
Messages
2,251
I think you need something like
"DemoTwoDataA20022003.mdb", (attachment, zip).
Look at Table, Form. Open Form1 and see.
 

Attachments

  • DemoTwoDataA20022003.zip
    8.9 KB · Views: 79

penfold1992

Registered User.
Local time
Today, 13:21
Joined
Nov 22, 2012
Messages
169
this is exactly what I wanted thank you.

I just wondered where is the logic behind what column it actually enters in the combo box when you click on a option? How is it deciding what to put in the box whether it is "ID" or "Name"

also what if my table looked like...

IN/OUT ID ADDRESS TIME NAME AGE COMMENTS

how could you select the two columns that are not adjecent or at the beginning of the table?

just curious, for the learning :)
 

Users who are viewing this thread

Top Bottom