Others

How to Fix Microsoft Access Name-Splitting Expressions in an Update Query

John WilsonJohn Wilson Oct 22, 2026 869 views

Question details

The user needs to correct syntax errors in expressions used to split names (formatted as 'Last, First') into separate fields within a Microsoft Access Update Query.

How to Fix Microsoft Access Name-Splitting Expressions in an Update Query
Product
Microsoft Access
Device & OS
not provided
Scenario
Separating full names into distinct first name and last name fields using an Update Query.
Observed behavior
The current InStr expressions produce errors or return incorrect text due to invalid arguments and syntax mistakes, often found in transcribed published examples.
Before you start

Ensure you have a recent backup of your Microsoft Access database before running any Update Queries, as these operations permanently modify your underlying data.

Solution 1Recommended

Use Corrected InStr Expressions for Last and First Names

Replace the incorrect syntax with reliable expressions that accurately locate the comma and space separating the names.

Transcription errors in published materials often lead to searching for empty strings or using wrong arguments. The corrected expressions below specifically look for a comma followed by a space, which properly handles complex names like 'Di Lorenzo'.

1
Open your Update Query in Design View

Navigate to the Queries section in the Microsoft Access navigation pane, right-click your target Update Query, and select Design View.

2
Update the Last Name field

In the 'Update To' row for your Last Name field, enter the following expression to extract the text before the comma: Left([ContactName], InStr([ContactName], ", ") - 1)

3
Update the First Name field

In the 'Update To' row for your First Name field, enter this expression to extract the text after the comma and space: Mid([ContactName], InStr([ContactName], ", ") + 2, 100)

4
Run the Update Query

Click the Run button (red exclamation mark) in the Query Design ribbon to apply the changes and split the names correctly in your table.

Use Corrected InStr Expressions for Last and First Names
Expression Verification: Make sure to replace '[ContactName]' with the exact field name used in your own database table to avoid parameter prompts.
Free Microsoft Office alternative

Looking for a Free Alternative for Your Data Tasks?

While WPS Office does not include a direct replacement for Microsoft Access databases, it offers a powerful Spreadsheet tool that can easily handle large datasets, split text into columns, and manage data without writing complex SQL expressions. Download WPS Office for a free, lightweight, and highly compatible productivity suite.

  1. 1. Export Access Data to Excel: Export your Microsoft Access table to an .xlsx file so your dataset can be easily edited in a spreadsheet environment.
  2. 2. Open with WPS Spreadsheet: Launch WPS Office and open your newly exported .xlsx dataset to begin editing.
  3. 3. Use Text to Columns: Select the column containing the full names, go to the Data tab, and click 'Text to Columns'. Choose 'Delimited', check the 'Comma' option, and instantly split your names into separate columns without writing any formulas.
Free to download and use for word processing, spreadsheets, and presentations.Easily split text and clean data using built-in 'Text to Columns' Spreadsheet tools instead of complex formulas.Fully compatible with Microsoft Excel (.xlsx) formats, making data migration from Access seamless.Lightweight installation with a familiar, easy-to-use tabbed interface.
microsoft office alternative - wps office

Frequently Asked Questions

Why does the InStr function return an error in my Access query?

The InStr function will return an error if it searches for an empty string, if a null value is passed without handling it, or if it uses invalid arguments. Ensure you are searching for a specific delimiter present in the text, such as a comma and space (", "), to avoid syntax errors.

How do I handle middle names when splitting names in Access?

Splitting names with middle initials or middle names requires more complex nested InStr and Mid functions to locate the second space. Alternatively, you can export the data to a spreadsheet program and use built-in 'Text to Columns' features for an easier, visual separation process.

Can I undo an Update Query in Microsoft Access?

No, Update Queries permanently alter the data in your database tables and cannot be undone via a simple 'Undo' command. Always make a copy of your table or backup the entire database before running an Update Query.

Why did my published Access tutorial provide incorrect code?

Code snippets in published books or online tutorials sometimes contain typographical or transcription errors from technical editors. Always verify expressions independently and adjust delimiters to match the exact formatting of your own data.