Others

Remove All Spaces from an Access Field with Replace

Muhammad TalhaMuhammad Talha Nov 25, 2026 868 views

Question details

Remove every ordinary space from the text in an Access field using a calculated expression.

Remove All Spaces from an Access Field with Replace
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.
Before you start

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.

Solution 1Recommended

Remove spaces in an Access query

Use a calculated query column to display text without spaces while leaving the original field unchanged.

1
Open Query Design

In Access, select Create > Query Design and add the table or query containing your field.

2
Add the expression

In a blank Field cell in the design grid, enter NoSpaceText: Replace([SomeField]," ",""). Replace SomeField with the actual field name.

3
Run the query

Select Run on the Query Design ribbon to view the NoSpaceText column alongside any other fields you added.

Remove spaces in an Access query
The original value stays unchanged: This calculated column displays a cleaned result; it does not update the stored field.
Free Microsoft Office alternative

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.

Remove ordinary spaces from spreadsheet text with a SUBSTITUTE formulaOpen and save Microsoft Excel XLSX filesUse a familiar spreadsheet interface for an easier transitionWork with documents, spreadsheets, and presentations in one lightweight suite
QA img-9

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.