Search code examples
ms-accessvbareport

How can I add a button to an Access report to export it to Excel / PDF?


How can I add a button to a Microsoft Access report to export it to Excel / PDF?


Solution

  • Christian has suggested a command button on a form, but you could also create a toolbar for the report with a button on it that would export the report to Excel. But as Tony says, the results are going to be ugly.

    I would say that more useful would be a button that exports the data displayed in the report to an Excel spreadsheet. Formatting wouldn't be as pretty, but it would be much more useful and manipulable. For that, you'd use DoCmd.TransferSpreadsheet and a saved Query as your export source (equivalent to the Recordsource of the report).