How to export query, subform from MS Access to Excel using VBA

March 21, 2015 | By | Reply More

This tutorial is going to show you how to export a MS Access query or a subform to Microsoft Access using VBA code. Too export subform or query, we can use DoCmd.OutputTo method. Its a pretty simple code to get the query exported to Excel and it will automatically opened in Excel after the export process is completed.

Here is the code:

[codesyntax lang=”vb”]

[/codesyntax]

Change the Q_Export_DHAssay to excel” with your query. E:\test.xls is the output file.

Tags: , , ,

Category: Programming

Leave a Reply