Sivasan
asked on
Command button event to export access query to excel and attach to email
Hi There,
I have form in access. I have a button on the form on click I export the result of a query in access to excel. I like to know if instead of saving it, if I can directly attach the excel as an attachment to a email to be send via outlook.
Code to export to excel
the on click event
Dim stDocName As String
Dim stLinkCriteria As String
'Export report to MS Excel
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "OrderviewQry", "C:\Temp\OrderReport.xls"
DoCmd.Beep
MsgBox "The Selected Orders will be exported to Excel and saved in"
------------------
thanks
S
I have form in access. I have a button on the form on click I export the result of a query in access to excel. I like to know if instead of saving it, if I can directly attach the excel as an attachment to a email to be send via outlook.
Code to export to excel
the on click event
Dim stDocName As String
Dim stLinkCriteria As String
'Export report to MS Excel
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "OrderviewQry", "C:\Temp\OrderReport.xls"
DoCmd.Beep
MsgBox "The Selected Orders will be exported to Excel and saved in"
------------------
thanks
S
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER