Display custom toolbar when open query?

D

Dorian

I need to run a query and allow the user to export the results to excel.
Is there any way to have a custom toolbar display when the query is opened
and disappear when it is closed, much like what you can do with a report via
its Toolbar property?
Thanks.
-- Dorian
"Give someone a fish and they eat for a day; teach someone to fish and they
eat for a lifetime".
 
F

fredg

I need to run a query and allow the user to export the results to excel.
Is there any way to have a custom toolbar display when the query is opened
and disappear when it is closed, much like what you can do with a report via
its Toolbar property?
Thanks.
-- Dorian
"Give someone a fish and they eat for a day; teach someone to fish and they
eat for a lifetime".

I don't think so in a query.

But, why do you need to actually open the query before exporting it to
Excel?
You can use the TransferSpreadsheet method to export the query data
without opening the query or Excel:

DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel97,
"MyQueryName", "C:\PathToFolder\MySpreadsheetName.xls",True

Look up the arguments in VBA help.
 
D

Dorian

Yes, I know how to do that but I need to display the query with a toolbar
that allows exporting to excel.
-- Dorian
"Give someone a fish and they eat for a day; teach someone to fish and they
eat for a lifetime".
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top