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
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

696 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