Connecting Tech Pros Worldwide Help | Site Map

Inserting Spaces Between Fields in Expression Builder

 
LinkBack Thread Tools Search this Thread
  #1  
Old November 12th, 2005, 06:14 PM
Darren
Guest
 
Posts: n/a
Default Inserting Spaces Between Fields in Expression Builder

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.

  #2  
Old November 12th, 2005, 06:15 PM
Helen Wheels
Guest
 
Posts: n/a
Default Re: Inserting Spaces Between Fields in Expression Builder

Darren wrote:[color=blue]
> 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.[/color]



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

  #3  
Old November 12th, 2005, 06:16 PM
Darren
Guest
 
Posts: n/a
Default Re: Inserting Spaces Between Fields in Expression Builder

Helen Wheels <helenwheelss@yahoo.com.au> wrote in message news:<400B9AD3.2010704@yahoo.com.au>...[color=blue]
> Darren wrote:[color=green]
> > 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.[/color]
>
>
>
> 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[/color]

Hi Helen,

That is exactly what I needed :) Thanks

Darren Stahlhut
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,840 network members.