Hi DMC
Instead of basing your list/combo box's RowSource on the Students table,
base it on a query like this:
Select [PrimaryKey], [FirstName] & " " & [LastName] as SName
from [YourTable] order by [FirstName], [LastName];
Of course you should substitute your own names for the table and fields as
required.
Then, set these other properties for the list:
ColumnCount: 2
BoundColumn: 1
ColumnWidths: 0
The ColumnWidths setting causes the first column to be hidden.
It will morph into "0 in" or "0 cm" but that doesn't matter.
Then you will see the name "John Smith" in the list, but what is actually
stored in your bound field will be the primary key value (StudentID) for
that student.
If you would prefer to see "SMITH, John", then set the RowSource to:
Select [PrimaryKey], UCase([LastName]) & ", " & [FirstName] as SName
from [YourTable] order by [LastName], [FirstName];
--
Good Luck
Graham Mandeno [Access MVP]
Auckland, New Zealand
DMC said:
I have two tables. One for classes and one for students. I want a drop
down
box or list box in the classes table to show all students. The fields in
the
student table are separate such as first and last name. I can choose
multiple names but it only shows the last name not first and last. Is
this
possible. DMC