Welcome to Bob Erhart's Internet Site
HOME
ADD MESSAGE
PAGE/EMAIL
TAKE A DEMO SURVEY
SEE DEMO SURVEY RESULTS
VBA DEMO
BACK TO SOURCE CODE LISTING
'========================================================= ' Function Name : SingleQuote(InString) ' Date : 4/31/99 ' Written By : R.G. Erhart ' Purpose : Return string with single quote chr(39) ' before and after string. ' Description : If the source string contains a single ' quote char, it will be converted to an ' underscore so SQL strings will work ' properly ' Language : VBasic ' Dependecies : None '========================================================= Private Function SingleQuote(InString) Dim i Dim OutChar for i = 1 to Len(InString) OutChar = Mid(InString,i,1) If Mid(InString,i,1) = "'" Then OutChar = "_" SingleQuote = SingleQuote & OutChar Next SingleQuote = chr(39) & SingleQuote & chr(39) End Function
© Copyright 1999, 2013, R.G. Erhart, Erhart Consulting LLC, Rochester New York