By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,493 Members | 1,179 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,493 IT Pros & Developers. It's quick & easy.

DoCmd.OutputTo -- From SQL String?

P: n/a
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

May 19 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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

May 20 '06 #2

P: n/a
Allen, this is exactly what I ended up doing. Thanks for the reply.

May 25 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.