Newbie Question about merging fields (1 Viewer)

C

ChestnutElf

Guest
Hello I am trying to build a basic mailing list database. I would like to a have a first name field, a last name field, and a name field for both first and last names. Is there any way I can just type the first two fields and they can merge in the third field or vice versa?:confused:
 

Alexandre

Registered User.
Local time
Today, 06:41
Joined
Feb 22, 2001
Messages
794
You don t need and must not have a complete name field or merge first and last name into a field.
This is precisely because you can at any moment use and eventually concatenate these data to do anything you want.
1. To define your fields, always break down your information into the smallest possible logical elements (ie FirstName, LastName but no complete name)
2. Never duplicate information in your database (ie CompleteName duplicates FirstName and LastName information)
3. (With very rare exceptions) Never store in your database information that can be derived/calculated from other fields (ie don t merge Firstname and LastName to put the result in another field)

For a better understanding, you should do some reading on the principles for designing relational databases (do a search on database design).

Try the following to see an illustration of how you can get the complete name at any moment: in the query design grid, add your table holding FirstName and LastName. In the first row of the first column, write:
CompleteName: [FirstName] & [LastName]
(replace 'FirstName' and 'LastName' with the actual names of your fields)
Run the query.

Hope this helps
 
Last edited:

Pat Hartman

Super Moderator
Staff member
Local time
Yesterday, 19:41
Joined
Feb 19, 2002
Messages
43,374
Slight correction:

CompleteName: Trim([FirstName]) & " " & Trim( [LastName])

The trim removes any leading/trailing spaces and a single space is placed between the two name components.
 

Users who are viewing this thread

Top Bottom