Calculated field or query (1 Viewer)

ColMac

New member
Local time
Today, 10:27
Joined
Sep 26, 2019
Messages
7
Hi Folks I'm very much a beginner, using Access for small hobby projects at home. I suspect I rarely use the most efficient way to do things, but they work.

My question today is about names. At various points in my small family history project, I want to see names formatted as

Surname, First & Middle names

or First name Middle names Surname

My base data currently consists of 3 separate fields, First name, Middle Names & Surname.

Is it better to created a calculated field in my table or use a query to generate the merged versions, or is there a far more sensible approach.

Thanks
 

isladogs

MVP / VIP
Local time
Today, 10:27
Joined
Jan 14, 2017
Messages
18,186
You are right to keep these as separate fields.
To 'combine' them, you concatenate the fields using a query or in code
For example add a query field
Code:
FullName: [First Name] & " " & [Middle Name] & " " & [Last Name]
The [] are only needed if your field names contain spaces or special characters
 

ColMac

New member
Local time
Today, 10:27
Joined
Sep 26, 2019
Messages
7
Perfect FAST reply. Thanks
 

isladogs

MVP / VIP
Local time
Today, 10:27
Joined
Jan 14, 2017
Messages
18,186
You're welcome.
Forgot to say that its advisable not to use spaces or special characters in field names
So e.g. FirstName is better than First Name.
No need for [] and less chance of typing errors.
 

ColMac

New member
Local time
Today, 10:27
Joined
Sep 26, 2019
Messages
7
Thanks again I did actually have them without spaces, and also as peopleFirstName format so I know where they come from too.

But I didn't know that that meant I didn't need the square brackets. So another thing learned. Thanks.
 

Users who are viewing this thread

Top Bottom