How to Remove Text After Opening Parenthesis in MS Access Query
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.

- 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.
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.
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.
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.
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.
Click 'Run' to view the datasheet. Verify that the extracted text is correct and that fields without parentheses remain unchanged.
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.

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.

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.




