Export Temporary Query

houseofturner

Registered User.
Local time
Today, 09:44
Joined
Dec 10, 2009
Messages
37
I have a simple function that says:

DoCmd.TransferSpreadsheet acExport, 10, "QueryName", "C:\FileName.xls", True, "TabName"

I want to export 5 or 6 very similar queries and I am concerned that my database is starting to just have way too many queries to be manageable.

Can I replace the query name with a piece of sql so that I am exporting the result of some SQL rather than just having an endless number of saved queries?
 
Why do you want to Export a query?
If you don't need them, Bin them.

A bit of housekeeping may be required.

All Forms and Reports should have there Record Source, If it is a query, pasted into the document and then, if not needed by any other object, deleted. (One or two may not allow this if it is a complex and long query)
You can easily recreate the query by copy and past back to the query object list if required.

I have recently deleted some 100 plus queries by this method.

The balance, if named sensibly, shouldn't be a hassle.
 
Can I replace the query name with a piece of sql so that I am exporting the result of some SQL rather than just having an endless number of saved queries?

Your query is SQL. May not look like it but just click sql in the view and there it is.
 
I need to export the results of the queries as they are sent to a client in Excel format on a regular basis. This is a large and complex db with lots of queries that just get exported to Excel spreadsheets for the client to look at the data.




Why do you want to Export a query?
If you don't need them, Bin them.

A bit of housekeeping may be required.

All Forms and Reports should have there Record Source, If it is a query, pasted into the document and then, if not needed by any other object, deleted. (One or two may not allow this if it is a complex and long query)
You can easily recreate the query by copy and past back to the query object list if required.

I have recently deleted some 100 plus queries by this method.

The balance, if named sensibly, shouldn't be a hassle.
 

Users who are viewing this thread

Back
Top Bottom