I have a very long SQL statment that I am coding in VBA. I can't fit it on a
line. Is there any way I can extext it? I used the _ character to no avail.
Thanks,
Stan
Two things: you should not try to split a quote-delimited string across
multiple lines; and the continuation flag is not "_" but " _" - a space
followed by an underscore. Try something like
Dim strSQL As String
strSQL = "SELECT this, that, theother" _
& " FROM tablename" _
& " WHERE this = 1223 AND That = 'XYX'" _
& <etc etc>
Note that you're using & to concatenate text strings together, and that those
text strings should contain the necessary blanks; I'm using " WHERE in order
to prevent the resulting SQL string from containing
tablenameWHERE
all run together.