I wrote some fairly long SQL queries in notepad, and then inserted them into my VBA code as is, and then formatted the multi-line line correctly each line at a time. For instance...
In a text editor, the query is as follows.
SELECT
a,
b,
c,
...,
n
FROM
table1,
table2,
...,
tableN
WHERE
etc
Then paste this into the VBA editor and manually add sqlStr = sqlStr and "...." to each line.
sqlStr = " SELECT "
sqlStr = sqlStr & " a,"
sqlStr = sqlStr & " b,"
sqlStr = sqlStr & " c,"
sqlStr = sqlStr & " ...,"
sqlStr = sqlStr & " n"
sqlStr = sqlStr & " FROM"
sqlStr = sqlStr & " table1,"
sqlStr = sqlStr & " table2,"
sqlStr = sqlStr & " ...,"
sqlStr = sqlStr & " tableN"
sqlStr = sqlStr & " WHERE"
sqlStr = sqlStr & " etc"
Does anyone know a tool that will allow me to automatically wrap VBA string stuff around my request (instead of adding it manually)? I assume that there is a site there, but I can not find it.
I could fine-tune something in Vi, but I cannot guarantee that I will do it on a computer on which I will have permission to install Vi.
! .