Export to Excel

M

microsoft

Hi

I am trying to export data from access to excel. I have used the following
code.

Private Sub Export_Click()
On Error GoTo Err_Export_Click

Dim stDocName As String

stDocName = "Trade Ticket"
DoCmd.OutputTo acReport, stDocName

Exit_Export_Click:
Exit Sub

Err_Export_Click:
MsgBox Err.Description
Resume Exit_Export_Click

End Sub

Trade ticket is the name of the report.

The export is pulling all the fields from the report into Excel. Is it
possible to have only certain fields exported from the report to the excel
document. Also is it possible to set the order in which the fields are
exported.

Thanks for any assistance in advance.
 

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