manipulating text values in calculated fields

  • Thread starter Thread starter iain
  • Start date Start date
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
 
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?
 
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
 
Back
Top