• Replacing double-quote with empty string (Access 2003)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Replacing double-quote with empty string (Access 2003)

    Author
    Topic
    #438106

    Hello,

    I have the following SQL that updates a field containing a single double-quote with an empty string. I can get this to work in a query window, however when I try doing the SQL in VBA, it doesn’t work. Does anyone know what I’m doing wrong?

    CurrentDb.Execute “UPDATE TLoc_Agile_MPN SET TLoc_Agile_MPN.MPNStripped = Replace([MPNStripped],””””,”)”

    Thanks in advance for your help.
    Drew

    Viewing 0 reply threads
    Author
    Replies
    • #1043646

      Try

      CurrentDb.Execute "UPDATE TLoc_Agile_MPN SET TLoc_Agile_MPN.MPNStripped = Replace([MPNStripped],Chr(34),'')"

      • #1043656

        Hans,

        After posting this, I had found that I could use…
        CurrentDb.Execute “UPDATE TLoc_Agile_MPN SET TLoc_Agile_MPN.MPNStripped = Replace([MPNStripped],'””‘,”)”

        However, your approach is much less confusing. Thank you for your help, it’s greatly appreciated!

    Viewing 0 reply threads
    Reply To: Replacing double-quote with empty string (Access 2003)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: