manipulating text values in calculated fields

I

iain

i have 2 fields, first name and surname and want to
combine them into one field. i have used the formula
suppiled in the access help pages;

FullName: [FirstName] & " " & [LastName]

the result of this is that i get a large space between the
first and last name instead of a single space, so

first name = joe
last name = smith

should =

joe smith

but the result is

joe smith

the gap is always equal as if it is a large tab space but
not wanted.

is there anyway i can get it so that i have a single space
between the names.

thanks in advance

iain
 
A

Allen Browne

The example you gave should produce one space, so there most be something
else happening here. Is the TextAlign property set to Distribute or
something?
 
J

John Spencer (MVP)

If this is coming from a linked file there could be trailing spaces. Also, in
SQL there is a char type that will have trailing spaces.

Try using the Trim function

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

And you can force trailing spaces into a Jet database field using VBA to the set
the value.

Allen said:
The example you gave should produce one space, so there most be something
else happening here. Is the TextAlign property set to Distribute or
something?

--
Allen Browne - Microsoft MVP. Perth, Western Australia.


iain said:
i have 2 fields, first name and surname and want to
combine them into one field. i have used the formula
suppiled in the access help pages;

FullName: [FirstName] & " " & [LastName]

the result of this is that i get a large space between the
first and last name instead of a single space, so

first name = joe
last name = smith

should =

joe smith

but the result is

joe smith

the gap is always equal as if it is a large tab space but
not wanted.

is there anyway i can get it so that i have a single space
between the names.

thanks in advance

iain
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top