Combo RowSource


B

Bill

I have a combo box whose underlying
query contains [FirstName] and [LastName]
as separate table fields. I want to populate the
RowSource with a formatted name:
"lastname, firstname". I tried to use a function as the
RowSource: =CompName([Lastname],[FirstName])
but that didn't work. Can I somehow code the
underlying query to define a field wherein the
first and last names are already formatted as I've
described above? If so, what's the syntax of the
expression?

Thanks,
Bill
 
Ad

Advertisements

G

Graham Mandeno

Hi Bill

You need a query with a calculated field. This goes into the field cell in
the query grid where you would normally select a field name.

FullName: [LastName] & ", " & [FirstName]
 
Ad

Advertisements

B

Bill

Thanks Graham, that's the syntax that I didn't
stumble onto.
Bill



Graham Mandeno said:
Hi Bill

You need a query with a calculated field. This goes into the field cell
in the query grid where you would normally select a field name.

FullName: [LastName] & ", " & [FirstName]

--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

Bill said:
I have a combo box whose underlying
query contains [FirstName] and [LastName]
as separate table fields. I want to populate the
RowSource with a formatted name:
"lastname, firstname". I tried to use a function as the
RowSource: =CompName([Lastname],[FirstName])
but that didn't work. Can I somehow code the
underlying query to define a field wherein the
first and last names are already formatted as I've
described above? If so, what's the syntax of the
expression?

Thanks,
Bill
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top