Trim spaces in address fields

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
 
R

Rick B

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.
 
G

Guest

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
 
D

Douglas J. Steele

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
 
L

Larry Daugherty

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
 

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