Delete Spaces

P

Paul

I have an access table (let's call it mytable), and I have a text field in
this table (lets call the text field mytextfield).

This field has thousands of records - and in some of the records there are
some spaces in the middle of the text.
e.g. -
sdf 875
345 678965
gh5 216

I want to delete ALL of the spaces in the records that have spaces.

Can anyone help please?

Thanks in advance

Paul
 
A

Allen Browne

1. Create a query into this table.

2. Drag mytextfield into the grid.
In the Criteria row under this field, enter:
Is Not Null

3. Change it to an Update query: Update on Query menu.
Access adds an Update row to the grid.

4. In the Update row under mytextfield, enter:
Replace([mytextfield], " ", "")

Run the query. All spaces are now replaced with no character, so there is no
need to save the query.
 
P

Paul

Thanks for that mate - I'm doing it on Access97 like the bloke above - so
your reply to him was what I needed - Ta mate
Paul

Allen Browne said:
1. Create a query into this table.

2. Drag mytextfield into the grid.
In the Criteria row under this field, enter:
Is Not Null

3. Change it to an Update query: Update on Query menu.
Access adds an Update row to the grid.

4. In the Update row under mytextfield, enter:
Replace([mytextfield], " ", "")

Run the query. All spaces are now replaced with no character, so there is no
need to save the query.

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

Reply to group, rather than allenbrowne at mvps dot org.

Paul said:
I have an access table (let's call it mytable), and I have a text field in
this table (lets call the text field mytextfield).

This field has thousands of records - and in some of the records there are
some spaces in the middle of the text.
e.g. -
sdf 875
345 678965
gh5 216

I want to delete ALL of the spaces in the records that have spaces.
 

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