PC Review


Reply
Thread Tools Rate Thread

Display custom toolbar when open query?

 
 
Dorian
Guest
Posts: n/a
 
      11th Jan 2010
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".
 
Reply With Quote
 
 
 
 
fredg
Guest
Posts: n/a
 
      11th Jan 2010
On Mon, 11 Jan 2010 10:19:01 -0800, Dorian wrote:

> 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.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
 
Reply With Quote
 
Dorian
Guest
Posts: n/a
 
      11th Jan 2010
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".


"fredg" wrote:

> On Mon, 11 Jan 2010 10:19:01 -0800, Dorian wrote:
>
> > 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.
> --
> Fred
> Please respond only to this newsgroup.
> I do not reply to personal e-mail
> .
>

 
Reply With Quote
 
 
 
Reply

« bmw | Report help »
Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom Toolbar does not display all buttons Pete Microsoft Excel Discussion 2 9th Aug 2011 12:06 PM
Display custom Ribbon/Toolbar in Query Design CP Microsoft Access 2 13th Jan 2010 04:30 PM
how to limit custom toolbar's display Dingding Microsoft Excel Programming 2 19th Nov 2007 03:53 PM
Custom Toolbar won't display Lynne Forsyth Microsoft Word Document Management 1 27th May 2004 09:21 PM
Custom toolbar + open Access Db Luis Microsoft Excel Programming 0 25th Sep 2003 11:49 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:25 PM.