>Sherry, it's fine putting an SQL in a memo field and executing it later as you are doing, but remember there cannot be any tab characters and especially a line (carriage) return. The most common mistake I've seen is not removing the last line return of the statement. Hope this helps.
Tabs (CHR(9)) are OK - they're treated as whitespace during macro-expansion if not enclosed within string delimiters, and are literal characters in a string. The semicolon continuation character, CR (CHR(13)) and LF (CHR(1)) characters used to break the statement into a multiline statement are, as noted in my message. Embedded CR and LF characters within a string will break macro execution:
cTest = 'foo = "[abc' + CHR(13) + CHR(10) + 'def]"'
&cTest && breaks
cTest = 'foo = "[abc' + SPACE(2) + 'def]"'
&cTest && works