Merging two fields into one?

S

SilverSword

Il give you an example of what I want to do - will explain it much easier.
I want to merge two fields from the same table which is about some people.
How do I merge one field from the table (such as their firstname) with
another (such as surname) to make it look like one field in a database form?
 
A

Al Campagna

SilverSword,
You can use concatenation to combine two (or more) text values.
This is not done in your table, but on a form, or in a query, or on a
report.

On a form, based on your names table, or a query against that table,
place a text control with a ControlSource of...
= FirstName & " " & SurName

Given FirstName = "John" and SurName = "Smith"... the above
would display as...
"John Smith"
--
hth
Al Campagna
Microsoft Access MVP 2006-2009
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 
D

Dorian

That might be a problem if you are intending to allow the user to update the
names. In that case, you would need separate controls bound to each table
column, unless you want to parse and separate the names out before updating
the row.
-- Dorian
"Give someone a fish and they eat for a day; teach someone to fish and they
eat for a lifetime".
 
J

Jeff Boyce

As Al points out, you are better off, in the long run, in keeping two
separate facts in two separate fields. If you need to have the values in
the two fields DISPLAYED as one, all points out that you can use a query to
concatenate them.

What Access stores and what you have it display does not need to be
identical.

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
 

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