ms access vba strip single quote from string

Posted on 2012-03-29
Last Modified: 2012-03-29
using this:

strSubj = DLookup("ActionLogAssignmentChangeEmailSubject", "tblEmailSettings", "SettingsID = 1") & Me.Call & " - " & Me.Customer & " - Closed: " & Me.Closed

me.customer may occasionally contain a single quote '

(IE, "Our Company Name's")

What's the best way to tackle this?
Question by:RossDagley1
  • 2
LVL 61

Accepted Solution

mbizup earned 500 total points
ID: 37781480
You can use the replace function:

strSubj = DLookup("ActionLogAssignmentChangeEmailSubject", "tblEmailSettings", "SettingsID = 1") & Me.Call & " - " & Replace( Me.Customer,"'","")  & " - Closed: " & Me.Closed

Author Closing Comment

ID: 37781485
perfect - I didn't know it would be as simple as to be able to do it inline like that. Thanks!
LVL 61

Expert Comment

ID: 37781487
Glad to help :)

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

778 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question