Exporting a pivot table into excel

G

Guest

Im using a form that links its parameters (combo boxes) to a query and
displays a subform in pivot table view underneath these parameters. All I
want to do is be able to export the subform (pivot table) into excel. I can
go into the subform itself and click 'export to microsoft excel' but i do not
want to do that.
Thanks to those who can help.
 
G

Guest

I figured something out. I just open the subform and export it to excel with
the docmd. Than close the subform. Here is the code

Private Sub ExportToExcelCommand_Click()

DoCmd.OpenForm "Subform", acFormPivotTable
DoCmd.RunCommand acCmdPivotTableExportToExcel
DoCmd.Close

End Sub
 

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