Merging two fields into one?

  • Thread starter Thread starter SilverSword
  • Start date Start date
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?
 
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."
 
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".
 
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.
 
Back
Top