By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,498 Members | 835 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,498 IT Pros & Developers. It's quick & easy.

Inserting Spaces Between Fields in Expression Builder

P: n/a
Hi All,

This will probably have the easiest solution but as I'm still a newbie
and need some help...

When building a query I would like to create a field called Name which
includes both the first and last name of the person.

Here's the expression:

Name: [tblStaff]![FirstName]+[tblStaff]![LastName]

It works great except for the fact that the is no space between the
first and last name.

Ideas???

Thanks in advance,
Darren Stahlhut.
Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Darren wrote:
Hi All,

This will probably have the easiest solution but as I'm still a newbie
and need some help...

When building a query I would like to create a field called Name which
includes both the first and last name of the person.

Here's the expression:

Name: [tblStaff]![FirstName]+[tblStaff]![LastName]

It works great except for the fact that the is no space between the
first and last name.

Ideas???

Thanks in advance,
Darren Stahlhut.


Hi Darren

You need to put in the space explicitly. Either of these should
work:

FullName: [tblStaff]![FirstName]+" "+[tblStaff]![LastName]
OR
FullName: [tblStaff]![FirstName]+chr(32)+[tblStaff]![LastName]

(32 being the ASCII code for the space character)
Note, it may be safer to call your calculated field something
like FullName as there is already a built-in Access property
called Name.

Cheers

Nov 12 '05 #2

P: n/a
Helen Wheels <he**********@yahoo.com.au> wrote in message news:<40**************@yahoo.com.au>...
Darren wrote:
Hi All,

This will probably have the easiest solution but as I'm still a newbie
and need some help...

When building a query I would like to create a field called Name which
includes both the first and last name of the person.

Here's the expression:

Name: [tblStaff]![FirstName]+[tblStaff]![LastName]

It works great except for the fact that the is no space between the
first and last name.

Ideas???

Thanks in advance,
Darren Stahlhut.


Hi Darren

You need to put in the space explicitly. Either of these should
work:

FullName: [tblStaff]![FirstName]+" "+[tblStaff]![LastName]
OR
FullName: [tblStaff]![FirstName]+chr(32)+[tblStaff]![LastName]

(32 being the ASCII code for the space character)
Note, it may be safer to call your calculated field something
like FullName as there is already a built-in Access property
called Name.

Cheers


Hi Helen,

That is exactly what I needed :) Thanks

Darren Stahlhut
Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.