Combines fields

G

Guest

We have a customer table in access, with separate fields for the first name
and last name. I need an additional field that combines these 2 fields. Is
there a way to do this without end user input, so the field is filled when
data is entered into the first and last name field?
 
G

Guest

Hi,

The LAST thing that you need is another field in the table. What you do is
create something like below every time you need the combined names in a
query, form, or report:

FullName: [FirstNameField] & " " & [LastNameField]
 
R

Rick B

You don't do that. That would be redundant. What if someone gets married
or divorced? You would then have to maintain two fields.

The proper way to handle this is to keep your table exactly as it is. Then,
in your FORMS, QUERIES, and REPORTS you can display the name as you mention.
If you want to display it as last,first in a form, for example, add a new
unbound text box to your form and put the following in it...

=[LastName] & ", " & [FirstName]

If you want to do this in a query, create a new "virtual" field in your
query by going to a new column and entering the following in your query...

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

You would then be able to use the new "field" name of [CombinedName] in any
report or form based on this query.

For more details, do a search. You are asking a ver common (and basic)
question and you should be able to find hundreds of posts out here that talk
about it. In the future, you should search for your answer before posting.
That is why the old posts are retained.

Good luck,
 
G

Guest

Thanks. I will do that.

Rick B said:
You don't do that. That would be redundant. What if someone gets married
or divorced? You would then have to maintain two fields.

The proper way to handle this is to keep your table exactly as it is. Then,
in your FORMS, QUERIES, and REPORTS you can display the name as you mention.
If you want to display it as last,first in a form, for example, add a new
unbound text box to your form and put the following in it...

=[LastName] & ", " & [FirstName]

If you want to do this in a query, create a new "virtual" field in your
query by going to a new column and entering the following in your query...

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

You would then be able to use the new "field" name of [CombinedName] in any
report or form based on this query.

For more details, do a search. You are asking a ver common (and basic)
question and you should be able to find hundreds of posts out here that talk
about it. In the future, you should search for your answer before posting.
That is why the old posts are retained.

Good luck,

--
Rick B



Davidjc52 said:
We have a customer table in access, with separate fields for the first
name
and last name. I need an additional field that combines these 2 fields. Is
there a way to do this without end user input, so the field is filled when
data is entered into the first and last name field?
 

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