Executing Multiple Queries

ewood23

New member
Local time
Today, 05:48
Joined
Aug 2, 2007
Messages
2
Is there a method of executing multiple sql statements against an access db?

If yes, can someone provide me with the instructions or the VBA template that i can use to develop a module that runs various sql statements and have the results written to an excel or word file.


Thanks,
Erron
 
That's fairly simple, or fairly complex, depending on the path. A simple macro will execute all the SQL you want against your DB. It's the exporting to Word/Excel that is potentially complex. If you're not worried about formatting and such, then SendObjects will do it. If you're trying to write out to templates, form letters, etc., then you're asking for an application of sorts. I'm sure plenty of us here will quote you what that might cost.
 
Another way is to create queries on the fly using SQL statements, refering to them to each other as required. Once you have done that, you can (as Moniker says) use docmd.sendobjects or docmd.transferspreadsheet. Suggest that you would output the data you want to a temporary table, format it there, then export to excel.

But have to ask yourself why do you want to do that? Access is more powerful than excel and still contains all the ability of excel.
 

Users who are viewing this thread

Back
Top Bottom