Combo box to show name for user, but input id to the tag table.

johnseito

Registered User.
Local time
Today, 01:31
Joined
Feb 27, 2013
Messages
89
I have a AUCTION form, it has a combo box and the label for this combo box
is called seller. This combo box is a look up to the USER table which has the following fields:

uid, uname, city, state

The combo box is pulling and displaying a drop down list of uname from the USER table, with this SQL state in the "row source".

Code:
SELECT user.uname FROM [user] ORDER BY user.uname;

in the control source of this combo box I have seller, and the form's record source is AUCTION, tagging on the AUCTION table.

the problem is the form is putting the uname into the AUCTION table's seller field, but I want it to input the uid field, however that it should still show the uname list when the user click on the combo box to make a selection.

How can this be done?

Thanks a lot!!
 
In the properties of the combo box, change these attributes

Row Source: SELECT user.uid, user.uname FROM [user] ORDER BY user.uname;
Column Count: 2
Column Widths: 0";1"
Bound Column: 1

Column Count tells the drop down how many columns are in the query (uid -> column 1 and username -> column 2). Column Widths tells it how much space to allow to show of each column (uid -> doesn't show, username -> shows up to 1 inch). Bound Column tells it which column to tie back to the underlying table (uid).
 
Thank you!

:-)
 

Users who are viewing this thread

Back
Top Bottom