Re: Combo Box Source from Same Table
- From: "Larry Linson" <bouncer@xxxxxxxxxxxxx>
- Date: Mon, 1 Aug 2005 19:46:18 -0500
"MM Spirit Guide" wrote
> SELECT tblPeople.ID, tblPeople.LastName, tblPeople.FirstName FROM
> tblPeople
> where tblPeople.HeadofHousehold = YES;
>
> Now what is happening is that it the combo box shows ONLY the IDs...
> so I get a list:
> 1
> 4
>
> Whereas I want it to show:
> 1 Smith John
> 4 Peeves George
>
> Any idea how to make it happen?
In your Combo Box properties, select a Column Count of 3 (in the Format
tab), and a Bound Column of 1 (in the Data Tab).
I'd use a calculated Field so that the name showed as "Smith, John",
"Peeves, George" -- the following is the SQL of the RowSource I use in a
very similar combo box:
SELECT [LastName] & ", " & [FirstName] AS EmpName, Employees.EmployeeID
FROM Employees
ORDER BY Employees.LastName, Employees.FirstName;
with Columns = 2, Bound Column = 2, and Column Widths = 1.5"; 0", it only
shows the names but is bound on the EmployeeID column. There's no need to
display the ID value -- it's only for your own internal use. It would show
the user just
Smith, John
Peeves, George
Larry Linson
Microsoft Access MVP
.
- References:
- Combo Box Source from Same Table
- From: MM Spirit Guide
- Combo Box Source from Same Table
- Prev by Date: Re: Passing data to report
- Next by Date: Re: Combo box woes
- Previous by thread: Re: Combo Box Source from Same Table
- Next by thread: Re: Set Focus after Navigate
- Index(es):
Relevant Pages
|