If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
FindFirst and Apostrophe
I get "error 3077 Syntax Error (missing operator) in expression" in this
expression: Rst.FindFirst "[Section]='" & Me!NewSection & "'" when Me!NewSection contains an apostrophe. How can I write the FindFirst expression so it works whether or not Me!NewSection contains an apostrophe? Thanks! Mark |
#2
|
|||
|
|||
FindFirst and Apostrophe
Try:
Rst.FindFirst "[Section]=""" & Me!NewSection & """" -- Duane Hookom MS Access MVP "Mark" wrote in message ink.net... I get "error 3077 Syntax Error (missing operator) in expression" in this expression: Rst.FindFirst "[Section]='" & Me!NewSection & "'" when Me!NewSection contains an apostrophe. How can I write the FindFirst expression so it works whether or not Me!NewSection contains an apostrophe? Thanks! Mark |
#3
|
|||
|
|||
FindFirst and Apostrophe
Mark wrote:
I get "error 3077 Syntax Error (missing operator) in expression" in this expression: Rst.FindFirst "[Section]='" & Me!NewSection & "'" when Me!NewSection contains an apostrophe. How can I write the FindFirst expression so it works whether or not Me!NewSection contains an apostrophe? As others have said the double quote thing, that can bring about the same problem if your text contains a double quote. The answer is to double up your quotes, e.g. Rst.FindFirst "[Section]='" & Replace(Me!NewSection,"'","''") & "'" -- Error reading sig - A)bort R)etry I)nfluence with large hammer |
Thread Tools | |
Display Modes | |
|
|