Trim spaces in address fields

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have fields for LName & Fname and would like to "trim" (maybe the wrong
term) the extra spaces from the fields so that when I have the two on a form
side by side it appears as John Doe not John Doe
 
this is posted all the time. Please read previous posts before posting a
new thread.

You would need to add an unbound text box to your form or report and put the
data as...

=[Fname] & " " & [LName]

Obviously the user will not be able to modify the data in that field. It is
simply for display purposes.
 
Thanks Rick. Sorry to bother you. I've been searching and didn't see what I
needed

Rick B said:
this is posted all the time. Please read previous posts before posting a
new thread.

You would need to add an unbound text box to your form or report and put the
data as...

=[Fname] & " " & [LName]

Obviously the user will not be able to modify the data in that field. It is
simply for display purposes.

--
Rick B



Sandy said:
I have fields for LName & Fname and would like to "trim" (maybe the wrong
term) the extra spaces from the fields so that when I have the two on a form
side by side it appears as John Doe not John Doe
 
Or, simpler,

Trim(([FName]) & " " & Trim([LName])

(You been spending too much time with Oracle again, Lynn? <g>)

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Lynn Trapp said:
LTrim(RTrim([FName])) & " " & LTrim(RTrim([LName]))

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm
Jeff Conrad's Big List: www.ltcomputerdesigns.com/JCReferences.html


Sandy said:
I have fields for LName & Fname and would like to "trim" (maybe the wrong
term) the extra spaces from the fields so that when I have the two on a
form
side by side it appears as John Doe not John Doe
 
Trim() is exactly the right function for removing leading and trailing
spaces. Space characters are not the problem. It's the fact that you
have to design textboxes with finite dimensions and peg their spacing
on the form.

The usual work-around is to replace the FName and LName textboxes with
an unbound textbox say "txtFullName" and set the value of txtFullName
=[FName] & " " & [LName]

A word of caution: Don't get rid of the fields in the table for FName
and LName. There is a value in having them separate; such as sorting
by last name.

HTH
 
Back
Top