473,396 Members | 2,026 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Pivot Command

21
I was hoping someone might be capable to assist

I have a form called FrmEmployeeCountPivot

And on the above mentioned i have a subform called FrmEmployeeCountPivotSub

The Sub is a Pivot Table

What i am trying to achieve is normally i will click on my pivot table comandbar, on the export to excell. And will work perfectly.

Now Because the sub is on my main form my Pivot Commandbar, does not appear anymore.

I would like to place the command on my main form to allow the user the send the pivot to excell exactly as it happens if i click the send to excel command on my menu..

Is there a way that use the send to excel menu command just behind an normal cmdbutton on my form

I tried creating a macro that uses
Runcommand - PivotTableExportToExcel but only get an error, action failed
is there a way that i can make use of the command on my subform.

Thank you very much in advance for any help

Regards
Sep 24 '08 #1
6 4258
hjozinovic
167 100+
Here is the code that you can put in OnClick event of your button:

Expand|Select|Wrap|Line Numbers
  1. stDocName = "name of query here"
  2. DoCmd.OpenQuery stDocName, acViewPivotTable, acEdit
  3. DoCmd.RunCommand acCmdPivotTableExportToExcel
  4. DoCmd.Close acQuery, stDocName, acSaveNo
Sep 24 '08 #2
natural
21
HI

Thank you for the assistance.

I was wondering, this allows me to export the data in query view, and then to add it to the pivot. When it is in Excell

Is there a way to export the current pivot as it is in Access

Thank you in advance
Sep 25 '08 #3
hjozinovic
167 100+
Yes there is. Try something like:
Expand|Select|Wrap|Line Numbers
  1. DoCmd.GoToControl "Subform Control Name Here"
  2. DoCmd.RunCommand acCmdPivotTableExportToExcel
Sep 25 '08 #4
natural
21
Brillinat

Thank you so much for the help..


Regards

Natural
Sep 29 '08 #5
Sorry to ask a question since it wasn't my original post, but is there a way to specify the file path and file name for the pivot that was exported to Excel. The code works great to transfer for the pivot in it's designed format, but I still have to manually save the output after it's sent to Excel. Thanks.
Oct 29 '08 #6
Stewart Ross
2,545 Expert Mod 2GB
Please do not hijack another poster's thread, or double-post your questions (see this thread). Thank you.

MODERATOR
Oct 29 '08 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: SharkFOA | last post by:
Hi, Hoping someone can help. I have created a pivot table and launch it via a command button. Unfortunately, it opens in form view and not in pivot table view. I have opened the form in design...
3
by: John | last post by:
Is there a way to code the button that's available in the query window--microsoft excel icon that exports to excel. I know transferspreadsheet will do this---but I want the query, which is in a...
0
by: Jillian Calderon | last post by:
I put a command button on the form and directed it the pivot table I created. I saved it and opened the form, but the command button doesn't lead to the pivot table. How can I get the command...
1
by: Jillian Calderon | last post by:
I put a command button on the form and directed it to the pivot table I created. I saved it and opened the form, but the command button doesn't lead to the pivot table. How can I get the...
9
by: PeteCresswell | last post by:
I've got something called "Reference Rates". The idea is that on a given day, we have various rates of return for various entities. e.g. Libor 3-month return, Libor 6-month return, US Treasury...
2
by: wujtehacjusz | last post by:
Dear All I am very new to MS SQL Server and I am wondering is there some tool which would allow me to build pivot tables in SQL more easily. At the moment writing a query can be quite...
1
by: christianlott1 | last post by:
I want to copy an Access pivot table into word with vba. I'm guessing I'd need to Select All, copy to the clipboard, and paste special into word at a bookmark. I know how to address the...
1
by: codepirate | last post by:
I have query that returns results like the following: request_id field_id field_value 12345 2 abc 12345 3 asdf 12345 11 10...
2
by: Marisol2 | last post by:
I have some queries in Access 2003 db that I have setup to display as pivots. I can go into design pivot table view and click on and then click on Export to Office MicroSoft Excel. The problem is I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.