Remove All Spaces from an Access Field with Replace
Question details
Remove every ordinary space from the text in an Access field using a calculated expression.

- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- The user is translating a FileMaker Pro database into Access and needs a calculation based on another field.
- Observed behavior
- The desired result is text with spaces removed throughout, rather than only from the beginning and end.
Identify the Access field that contains the text and decide whether you need the cleaned result in a query or on a form. The expressions below remove ordinary space characters, not other whitespace such as tabs.
Remove spaces in an Access query
Use a calculated query column to display text without spaces while leaving the original field unchanged.
In Access, select Create > Query Design and add the table or query containing your field.
In a blank Field cell in the design grid, enter NoSpaceText: Replace([SomeField]," ",""). Replace SomeField with the actual field name.
Select Run on the Query Design ribbon to view the NoSpaceText column alongside any other fields you added.

Remove spaces in an Access form control
Use a calculated text box when you want a form to display the cleaned value.
Clean Spreadsheet Text with WPS Office
For spreadsheet work alongside your database project, WPS Office is a free, lightweight, easy-to-use alternative with a familiar interface and Microsoft Office format compatibility. Open existing workbooks to transition spreadsheet tasks without rebuilding them. WPS does not replace or fix Microsoft Access databases.

Frequently Asked Questions
How is Replace different from Trim in Access?
Replace([SomeField]," ","") removes ordinary spaces throughout the text. Trim removes spaces only from the beginning and end.
Will the query expression change the data stored in my table?
No. A calculated column in a select query displays the result without changing the underlying field.
What if the field contains Null values?
If you want Null values to produce an empty string, use NoSpaceText: Replace(Nz([SomeField],"")," ","") in an Access query.
Can I use the cleaned value in another calculation?
Yes. You can build a second query based on the query containing NoSpaceText and refer to that column in the new calculation. Function support may differ in table calculated fields.
Does this expression remove tabs as well as spaces?
No. Replace([SomeField]," ","") targets ordinary space characters. Tabs and other whitespace require separate handling.




