Others

How to Move Text After the Final Space to Another Field in Microsoft Access

Emma BrownEmma Brown Oct 26, 2026 868 views

Question details

Extract the final word from a text string (after the last space) in one field and move it into a separate field.

How to Move Text After the Final Space to Another Field in Microsoft Access
Product
Microsoft Access
Device & OS
not provided
Scenario
Reorganizing database tables where users need to separate the last word of a string into a dedicated column.
Observed behavior
The goal is to automatically update the table so the original field retains everything before the last space, and the new field contains only the word after the final space.
Before you start

Always create a backup copy of your database table before running an Update Query, as these queries permanently modify the existing data and cannot be undone.

Solution 1Recommended

Use an Update Query with InStrRev, Left, and Mid

This method is recommended because it processes the entire table automatically using standard SQL functions built into Access without requiring programming knowledge.

The InStrRev function searches for a space from the end of the string backward, allowing the Left and Mid functions to accurately split the string exactly at the last space.

1
Create a New Query

Open your Microsoft Access database, navigate to the 'Create' tab on the ribbon, and click on 'Query Design'.

2
Switch to SQL View

Close the 'Show Table' dialog box without adding any tables. Right-click the query tab and select 'SQL View' from the context menu.

3
Enter the SQL Code

Paste the following update query: UPDATE Table1 SET Pink = IIf(InStrRev([Pink]," ")>0,Left([Pink],InStrRev([Pink]," ")-1),[Pink]), Purple = IIf(InStrRev([Pink]," ")>0,Mid([Pink],InStrRev([Pink]," ")+1),Null) WHERE Purple Is Null;

4
Adjust Table and Field Names

Replace 'Table1' with your actual table name. Replace 'Pink' with the name of the original text field, and 'Purple' with the name of the destination field.

5
Run the Query

Go to the 'Query Design' tab on the ribbon and click the red exclamation mark icon ('Run') to execute the update. Click 'Yes' when prompted to confirm the row updates.

Use an Update Query with InStrRev, Left, and Mid
Query Variations: You can also use a simpler WHERE clause if preferred: WHERE InStrRev([Pink]," ")>0;
Free Microsoft Office alternative

Looking for a Free Office Suite? Try WPS Office

While Microsoft Access handles complex relational databases, many data tracking and text-splitting tasks are much easier in a spreadsheet environment. WPS Office provides a free, lightweight, and highly compatible alternative to Microsoft Office, featuring robust spreadsheet capabilities for all your data management needs.

  1. 1. Download and Install: Visit the official WPS Office website to download and install the free suite on your device.
  2. 2. Open Your Data: Export your Access data to an Excel file and open it seamlessly in WPS Spreadsheet.
  3. 3. Split Text Easily: Use the built-in 'Text to Columns' feature under the Data tab to split text visually without writing code.
Free to use with a lightweight and fast installation processHighly compatible with Microsoft Excel, Word, and PowerPoint formats (XLSX, DOCX, PPTX)Easily split text using intuitive Text to Columns or Flash Fill features without writing SQLFamiliar user interface for a seamless transition from other office suites
microsoft office alternative - wps office

Frequently Asked Questions

What does the InStrRev function do in Microsoft Access?

InStrRev stands for 'In String Reverse'. It searches for a specified substring (like a space) within a larger string, starting from the end of the string and moving backward, and returns its numerical position.

Can I split the text using a comma instead of a space?

Yes. Simply replace the space character " " in the InStrRev function with a comma "," within your Update Query's SQL code.

How do I undo an Update Query if I make a mistake?

You cannot undo an Update Query in Access once it has been executed. This is why it is highly recommended to copy and back up your table before running any action queries.

Why shouldn't I use the VBA Replace function for the original field?

If you use Replace(Pink, Purple, ""), it will remove every instance of the final word from the entire string. If the last word also appeared earlier in the text, it would be unintentionally deleted there as well.