I have a humungous table (I will admit badly designed by someonelse) that has two groups of Address information, 11 groups of License type Information, and expiration date. (And other stuff)
The user would like to have a form where they choose:


-Address from (Business | Personal)
-License Type from one of the 11 possible
-Month and Year of Expiration
and have the information come back as an Excel spreadsheet.

I've done some experimenting with docmd.OutputTo and having it go to the spreadsheet. The problem is OutputTo wants it based on a query that exists in the Query Collection. I have taken a "Joe Gunchy" approach with the "Click" function looking at the Address and Type information and using a Select Case decide which of 22 Queries to call. Each of the queries then prompt the user for Year and Month. The results are then displayed in an Excel spreadsheet.

Does anyone have any positive luck with either OutputTo taking a SQL defined in the code or changing the SQL of a query in the Queries Collection from within VBA??? That way, I would only have to have 1 query that does as needed instead of the 22 that then prompt the user for the Year / Date.

Thanks
Paul