Hi, is me again. I found the solution. This is how to do it using vbscript:
1. first remove any leading spaces.
StatusComment = trim(txtStatusComment)
2. find the length of the variable in question
L=len(trim(StatusComment))
3. declare a dommy variable
Dim TXT1
4. write a loop
for z = 1 to L
5. write a decision testing to look for an apostrophy
6. while running the loop test for the presents of the apostrophy
7. if it is found add the apostrophy code as it is below
8. else add the characters that arenât apostrophy until the loop end.
if mid(StatusComment, z, 1) = "'" then
TXT1 = TXT1 & "'" & chr(39) & ""
else
TXT1 = TXT1 & mid(StatusComment, z, 1)
end if
next
The entire sample code
***********************
StatusComment = trim(txtStatusComment)
L=len(trim(StatusComment))
Dim TXT1
for z = 1 to L
if mid(StatusComment, z, 1) = "'" then
TXT1 = TXT1 & "'" & chr(39) & ""
else
TXT1 = TXT1 & mid(StatusComment, z, 1)
end if
next
arnniema
|