Delete spaces in an entry

D

Dimitris

Hello in a field of a table lets call it F1 of Table1, there is data entered
but with "spaces at the begining or the end of the text. And maybe more than
one "spaces". For example the word "Smith" is entered: " Smith" or "Smith "
or
" Smith ". I want to get rid of all the spaces that are at the beginning
or/and the end of the word and just have "Smith" entered with no spaces at
all at the beginning and end. Note that there may be spaces at the beginning
or at the and or at both begining and end and not the same amount of spaces.

Can someone help?
Thank you
Dimitris
 
D

Dennis

I suggest you take a backup copy of your table before trying this in case you
make any mistakes.
Create a query and put your field F1 in the query grid. Change the query
type to an update query and then in the update to row of your F1 field, enter
Trim(F1)
 
F

fredg

Hello in a field of a table lets call it F1 of Table1, there is data entered
but with "spaces at the begining or the end of the text. And maybe more than
one "spaces". For example the word "Smith" is entered: " Smith" or "Smith "
or
" Smith ". I want to get rid of all the spaces that are at the beginning
or/and the end of the word and just have "Smith" entered with no spaces at
all at the beginning and end. Note that there may be spaces at the beginning
or at the and or at both begining and end and not the same amount of spaces.

Can someone help?
Thank you
Dimitris

In VBA help, look up the Trim function.

In a query you would create a new column.

NewField:Trim([FieldName])

Then use this new column in your report, or whatever.
 

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