Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

ms access vba strip single quote from string

Posted on 2012-03-29
3
Medium Priority
?
343 Views
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?
0
Comment
Question by:Ross
  • 2
3 Comments
 
LVL 61

Accepted Solution

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

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

Author Closing Comment

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

Expert Comment

by:mbizup
ID: 37781487
Glad to help :)
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

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

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
Suggested Courses

916 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