Results 1 to 8 of 8
  1. #1
    JonoGee is offline Novice
    Windows 10 Office 365
    Join Date
    Aug 2022
    Posts
    27

    Double Quotation Marks holding a Double Quotation Mark? How To?

    Hi Folks. Good evening. Its been a while. I have been developing my skills through lots of practice.


    However, I have just stumbled across a little problem I can seem to figure out or find the right words in a search to find the right result.

    I want to use an expresison in a query to return a string that is in double quotation marks..
    Wanted Result.... "SampleFieldData = SampleFieldData2"; including the quotation marks and semi colon at the end

    So i have tried.... Wanted Result: """ & [SampleFieldData] & "=" & [SampleFieldData2] & "";"

    Nothing I try seems to enjoy 3 Double exclamation marks being used..

    Any ideas please folks..?

  2. #2
    Minty is online now VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,158
    Sometimes you can use Chr(34) instead of the quote or single quotes:

    Result = Chr(34) & "[SampleField1] = SampleField2 " & Chr(34) & ";"
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  3. #3
    JonoGee is offline Novice
    Windows 10 Office 365
    Join Date
    Aug 2022
    Posts
    27
    Thanks for the quick reply....
    I have given it a go but I am getting the following results..... "[CustomFieldName] = [CustomFieldValue] ";

    I used this in the query..... CustomFieldLine: Chr(34) & "[CustomFieldName] = [CustomFieldValue] " & Chr(34) & ";"

    Have i done something wrong you can see? The fields [CustomFieldName] & [CustomFieldValue] are fields in the query

  4. #4
    davegri's Avatar
    davegri is offline Excess Access
    Windows 11 Access 2019
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,742
    Result: Chr(34) & [column1] & " = " & [column2] & Chr(34) & ";"

    Click image for larger version. 

Name:	qhello.png 
Views:	22 
Size:	6.6 KB 
ID:	49495

  5. #5
    JonoGee is offline Novice
    Windows 10 Office 365
    Join Date
    Aug 2022
    Posts
    27
    Thank you very much Dave. Worked a treat!!

  6. #6
    davegri's Avatar
    davegri is offline Excess Access
    Windows 11 Access 2019
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,742
    Quote Originally Posted by JonoGee View Post
    Thank you very much Dave. Worked a treat!!
    Glad to help. In general, if you want double quotes to show as part of the string, rather than to act as delimeters, you can use chr(34). Also, chr(39) is a single quote.

  7. #7
    Minty is online now VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,158
    I read it too literally. Doh!
    Glad Dave sorted it out.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  8. #8
    davegri's Avatar
    davegri is offline Excess Access
    Windows 11 Access 2019
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,742
    Quote Originally Posted by Minty View Post
    I read it too literally. Doh!
    Glad Dave sorted it out.
    It was a bit confusing whether the OP wanted to show the variables or the variable values. All's well that ends well.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Dlookup Quotation Marks
    By Thompyt in forum Programming
    Replies: 3
    Last Post: 01-14-2019, 05:30 PM
  2. InStr() and quotation marks
    By Puebles in forum Programming
    Replies: 3
    Last Post: 11-22-2013, 07:36 AM
  3. Replies: 2
    Last Post: 04-17-2013, 04:59 AM
  4. Concatenate Quotation Marks
    By millerdav99 in forum Programming
    Replies: 3
    Last Post: 04-11-2011, 09:36 AM
  5. Transferring text within quotation marks
    By Lynette in forum Access
    Replies: 6
    Last Post: 11-24-2010, 11:58 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums