Display Name vs ID in Combo Box

  • Thread starter Thread starter Pamela
  • Start date Start date
P

Pamela

I have a query-based combo box on my form. The field is the ClientCoID which
is a foreign key and is long integer.
My Row Source is:
SELECT qry_ClaimCo.ClientCoID FROM qry_ClaimCo;
I want it to show the entries from the field ClientCoName which is also in
the query. Any suggestions would be greatly appreciated!

Pamela
 
I have a query-based combo box on my form. The field is the ClientCoID which
is a foreign key and is long integer.
My Row Source is:
SELECT qry_ClaimCo.ClientCoID FROM qry_ClaimCo;
I want it to show the entries from the field ClientCoName which is also in
the query. Any suggestions would be greatly appreciated!

Pamela

Just add the field to the combo row source:

SELECT qry_ClaimCo.ClientCoID, qry_ClaimCo.ClientCoName FROM
qry_ClaimCo Order By ClientCoName;

Then, set the Combo Column count property to 2.
Set the Bound column to 1.
Set the Column Widths property to
0";1"

Set the Combo Control Source to the ClientCoID field (as it is now).

Only the ClientCoName will display in the combo. When selected the
ClientCoID will be saved in the table.
 
Back
Top