Removing Space from Field in A Table

XLML

Active Member
Joined
Aug 15, 2003
Messages
407
Hi,

I have a space in one of the fields in an Access table. The field is;

xxx- xxxxx

I would like to remove the space after the hyphen.

Any ideas?
XLML
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Create a new query with the field as:

=LEFT([FieldName],4) &RIGHT([FieldName],5)

I'm not sure what the rest of the query looks like but here is SQL for an update query.

UPDATE Table1 SET Table1.Field1 = Left([Field1],4) & Right([Field1],5);


HTH,
CT
 
Upvote 0
Another option:

Open your table and highlight the field that needs to be fixed.
Select "Replace" from the Edit drop down menu replace a hyphen and a space ("- ") with just a hyphen ("-").
Be sure to select the "Match any part of Field" in the Match option, and click Replace All.
 
Upvote 0
Thanks for the replies. I tried jmiskey's option.

It worked albeit a little slow with a side problem. After every 9,494 records of a >100K DB, it would give the message "You can't replace the current value of the field with the replacement text." I would have to click OK then restart the process.

Any ideas why?
XLML
 
Upvote 0

Forum statistics

Threads
1,221,846
Messages
6,162,378
Members
451,760
Latest member
samue Thon Ajaladin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top