Could you create a query for this purpose, and assign your SQL string to the
QueryDef's SQL property before calling OutputTo?
This example assumes that MyOutputQuery has been created so it can be used
for this purpose:
Dim strSql As String
strsql = "SELECT ...
dbEngine(0)(0).QueryDefs("MyOutputQuery").SQL = strSql
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users -
http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"Vincent" <an**********@verizon.net> wrote in message
news:11*********************@i39g2000cwa.googlegro ups.com...
I am building an SQL string in a subroutine and was wondering if this
could be passed directly to the docmd.outputto method as the source of
the output I wish to generate. It does not appear you can do this, but
maybe I am missing something. Thanks.
-Vincent