Steve Schapel
steve at datamanagementsolutions.biz
Mon Jan 23 22:26:33 CST 2012
Many thanks, Stuart. I had been trying to test it in the Immediate Window using the literal string with the " in it. Which didn't work. But whacking it into a variable in code, as you have showed, or even just referring to the value of a textbox, it's fine. Appreciate your help! Regards Steve -----Original Message----- From: Stuart McLachlan Sent: Tuesday, January 24, 2012 5:03 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] double and single quotes Use two double quotes in a row inside literal string. Us four double quotes in a row outside of a string The following are synonomous: strTemp = "fr''''ed" 'that's two in a row in the middle strTemp = "fr'' & Chr$(34) & ''ed" strTemp = "fr" & """" & ''ed" 'that's four in a row Use either CHr$(34) or four double quotes in a row """" in your functions INSTR(strTemp,"""") INST(strTemp,Chr$(34)) strTemp = Replace(strTemp,chr$(34),chr$(39)) strTemp = Replace(strTemp,"""","'") -- Stuart On 24 Jan 2012 at 16:48, Steve Schapel wrote: > Hi all. > > I know I have done this before, but somehow I can´t get it today! > > How can I use InStr() to detect that there is a " in "fr"ed" ? > > How can I use Replace() to change "fr"ed" to "fr'ed" ? > > Thanks a lot. > > Regards > Steve > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com -- Stuart McLachlan Ph: +675 340 4392 Mob: +675 7100 2028 Web: http://www.lexacorp.com.pg -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com