Others

How to Remove Text After Opening Parenthesis in MS Access Query

Amos GikundaAmos Gikunda Oct 20, 2026 870 views

Question details

The user needs to remove all text following the first opening parenthesis within a text field using an MS Access update query, without causing errors for records that lack a parenthesis.

How to Remove Text After an Opening Parenthesis in MS Access
Product
MS Access
Device & OS
not provided
Scenario
Cleaning up or formatting database text fields by trimming unwanted characters starting from a specific symbol.
Observed behavior
The goal is to truncate the string at the first opening parenthesis and leave the original text intact if no parenthesis exists.
Before you start

Test your string manipulation expression in the Immediate window or a Select Query first to verify the results before applying it directly to an Update Query.

Solution 1Recommended

Use Left and InStr Functions to Trim Text

Apply a combination of the Left and InStr functions to dynamically find the parenthesis and extract the preceding text.

The InStr function locates the position of the parenthesis, while the Left function extracts the characters before it. Appending a parenthesis to the field in the InStr function ensures no errors occur if the field does not contain one.

1
Test in the Immediate Window

Press Ctrl+G to open the Immediate window and test the expression by typing: ?Left("sample text (to remove", InStr("sample text (to remove" & "(", "(") - 1) and pressing Enter.

2
Create a Select Query

Navigate to the Create tab, open a new Select Query, and add your table. Insert the expression Left([YourField], InStr([YourField] & "(", "(") - 1) into a new column, replacing [YourField] with your actual field name.

3
Run and Verify

Click 'Run' to view the datasheet. Verify that the extracted text is correct and that fields without parentheses remain unchanged.

4
Execute the Update Query

Once verified, change the query type to an Update Query. Place the exact expression into the 'Update To' row of your target field and click 'Run' to update the records.

Use Left and InStr Functions to Trim Text
Handling Missing Parentheses: The expression [YourField] & "(" guarantees that InStr always finds a parenthesis, preventing a 'Null' or 'Invalid Procedure Call' error during the query execution.
Free Microsoft Office alternative

Looking for a Free Alternative to Microsoft Office?

While WPS Office does not include a database management tool like MS Access, it is a highly compatible, free, and lightweight alternative for your core productivity needs, including Word documents, Excel spreadsheets, and PowerPoint presentations.

Fully compatible with Microsoft Office formats (.docx, .xlsx, .pptx).Lightweight installation with blazing-fast startup times.Familiar user interface for a seamless migration.Includes built-in PDF editing tools for free.
microsoft office alternative - wps office

Frequently Asked Questions

Why do I get an error when a record doesn't have a parenthesis?

This happens because the InStr function returns 0 if the target character is not found, causing the Left function to fail. Appending an extra parenthesis to your field inside the InStr function (e.g., [YourField] & "(") ensures a parenthesis is always found, preventing this error.

Can I use this expression to remove text after other characters, like a comma or hyphen?

Yes. Simply replace the opening parenthesis in the expression with your desired character. For example, to remove text after a comma, use: Left([YourField], InStr([YourField] & ",", ",") - 1).

How do I test the expression before modifying my database table?

You can test the expression by creating a Select Query first. Add the expression as a new field column and view the datasheet. This allows you to preview the results without altering your original data.