Title: Message
Corinna is correct, the instr() needs to be compared to a number
 
if instr( "TEST","E") then
 
would never evaluate to true since true = -1 and instr() will always return a number >= 0
 
My answer should have been
 

Dim Quote as string  ' if you need / want to dim your variables

 

Quote = chr(34)  ' Ascii value for "  use an ascii table or ?ASC("A")  to find - works for almost any character BUT the "

 

If InStr(D("Paragraph"), Quote) > 0  Then

  Exit Sub

End If

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Turner, Peter
Sent: Monday, January 10, 2005 4:42 PM
To: [email protected]
Subject: RE: [Talk] Escape character for quotes

Try

Dim Quote as string  ' if you need / want to dim your variables

 

Quote = chr(34)  ' Ascii value for "  use an ascii table or ?ASC("A")  to find - works for almost any character BUT the "

 

If InStr(D("Paragraph"), Quote) Then

   '  If InStr(D("Paragraph"), """) Then

Exit Sub

End If

 

 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paul Brungardt
Sent: Monday, January 10, 2005 4:25 PM
To: [email protected]
Subject: [Talk] Escape character for quotes

Does anyone know of a way to search for a quotation mark within a string?

I get a compile/syntax error when I try to use the lines listed below.

Thanks!

Paul

 

If InStr(D("Paragraph"), """) Then

Exit Sub

End If

 

 

 

 

Paul Brungardt

Clinical Analyst

HaysMedicalCenter

PH: 785-623-2196

PG: 785-650-5989

 

Reply via email to