Public Function ExportCurrentReportToExcel()
On Error GoTo Problem
DoCmd.OutputTo acOutputReport, Screen.ActiveReport.name, _
acFormatXLS, Screen.ActiveReport.name & ".xls", True
Exit Function
Problem:
Dim errorDesc, errNo
erroDesc = Err.Description
errNo = Err.Number
MsgBox "Error encountered while exporting." & vbCrLf & vbCrLf & _
"Error No: " & errNo & vbCrLf & vbCrLf & _
" Error Desc: " & errDesc, , "There Has Been An ERROR!"
End Function
Next create a macro in the Access DB and point it to run the above code.
Finally add a new button to your custom toolbar by selecting All Macros from the list in the customise toolbar dialog box and pick your new macro.
The above resolved my problem for now.
Sarah
Groups.io Links:
You receive all messages sent to this group.
View/Reply Online (#115804) | Reply To Group | Reply To Sender | Mute This Topic | New Topic
Mute #'
Your Subscription | Contact Group Owner | Unsubscribe [sugeng.panjalu.access@blogger.com]
Tidak ada komentar:
Posting Komentar