Display both columns in a Lookup field

G

Guest

Okay, here is my question. I am creating a lot of forms for users, and I need
them to be able to select Clients through a Lookup field, which selects the
first and last names from the main client table. The Lookup field is working
fine, and all of the client names show up when you click on the drop down
box. However, once a name is selected, the box only shows the value from the
first column.

For example: I select "John Brown" in the dropdown list. Once I have
selected this, and focus leaves the list, the value only shows "John." How do
I get my Lookup list to show BOTH columns in the lookup field, and not just
the first one?
Thanks!
Rose.
 
A

Allen Browne

Set these properties for your combo:
Row Source: SELECT [ClientID], [FirstName] & " " & [Surname] AS
FullName FROM tblClient;
Bound Column: 1
Column Count: 2
Column Widths: 0

The Row Source query statement combines the 2 fields into one.
 
G

Guest

Thanks so much Allen!! That actually worked this time! I've been trying to
figure that out for ages.

Now, for the next question following that -- once the name is selected in
the form, the user will click a button that runs a query that then outputs to
a report. That works fine, and the correct records are showing up in the
query. However, in the query, the names still appear separately. That in
itself is not a problem, but, in the report I need the full name to show up
at the top, and I can't figure out how to concantenate the names for the
report. How would I go about this?
Thanks!
Rose.

Allen Browne said:
Set these properties for your combo:
Row Source: SELECT [ClientID], [FirstName] & " " & [Surname] AS
FullName FROM tblClient;
Bound Column: 1
Column Count: 2
Column Widths: 0

The Row Source query statement combines the 2 fields into one.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Rose H. said:
Okay, here is my question. I am creating a lot of forms for users, and I
need
them to be able to select Clients through a Lookup field, which selects
the
first and last names from the main client table. The Lookup field is
working
fine, and all of the client names show up when you click on the drop down
box. However, once a name is selected, the box only shows the value from
the
first column.

For example: I select "John Brown" in the dropdown list. Once I have
selected this, and focus leaves the list, the value only shows "John." How
do
I get my Lookup list to show BOTH columns in the lookup field, and not
just
the first one?
Thanks!
Rose.
 
G

Guest

Thanks so much for your help Allen! Disregard my second message about the
reports -- I figured it out!
Thanks -- it works great!
Rose.

Allen Browne said:
Set these properties for your combo:
Row Source: SELECT [ClientID], [FirstName] & " " & [Surname] AS
FullName FROM tblClient;
Bound Column: 1
Column Count: 2
Column Widths: 0

The Row Source query statement combines the 2 fields into one.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Rose H. said:
Okay, here is my question. I am creating a lot of forms for users, and I
need
them to be able to select Clients through a Lookup field, which selects
the
first and last names from the main client table. The Lookup field is
working
fine, and all of the client names show up when you click on the drop down
box. However, once a name is selected, the box only shows the value from
the
first column.

For example: I select "John Brown" in the dropdown list. Once I have
selected this, and focus leaves the list, the value only shows "John." How
do
I get my Lookup list to show BOTH columns in the lookup field, and not
just
the first one?
Thanks!
Rose.
 

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