Xuất từ Access ra excel mà không cần phải có file định sẵn
trungminh > 17-09-16, 07:55 PM
Mọi người giúp hộ xem có cách nào xuất từ Access ra excel mà không cần có file định sẵn bằng lệnh không
Ví dụ: có table access là "hochanh" mình muốn xuất ra excel có tên là HOCHANH_date()
Như Ongke0711 làm cho mình về report
Private Sub In_Click()
Dim myPath As String
Dim strReportName As String
DoCmd.OpenReport "Baocaonam", acViewPreview
myPath = "C:\Documents and Settings\"
strReportName = "Baocaonam_" & Format(Date(),"ddmmyyyy") & ".pdf"
DoCmd.OutputTo acOutputReport, "", acFormatPDF, myPath & strReportName, True
DoCmd.Close acReport, "Baocaonam"
End Sub