View Full Version : Combine queries


thart21
04-28-2008, 09:38 AM
Wondering if this is possible. I'm trying to clean-up my db and have about 8 separate SELECT queries that I am running from a macro and exporting to Excel. Can I create a module with all of these queries so I can delete the 8 separate ones?

Thanks

Alisa
04-28-2008, 01:16 PM
You can't put queries directly into a module. If you want to, you can rewrite everything (the code to run the queries and the SQL syntax for each query) in VBA in a module . . .

Kiwiman
04-28-2008, 01:38 PM
I may be wrong, but you can use sql queries to run action queris or to form a recordset, but not to run a select query. I would definitley be interested if this is wrong. To put this in a module, I think you will need to have the underlying queries anyway...

thart21
04-28-2008, 02:15 PM
That's what I meant, sorry I wasn't clear on that. I do want to create all of the queries within the module, just wasn't sure if it was doable or even made sense.

Thanks!