Private Sub Command34_Click()
On Error GoTo Err_Command34_Click
Dim Qdf As DAO.QueryDef, strSQL As String
strSQL = "SELECT Q_SHPreview.* FROM Q_SHPreview"
If Me.F_MOHZPreviewWindow.Form.FilterOn = True And Me.F_MOHZPreviewWindow.Form.Filter <> "" Then
strSQL = strSQL & " Where " & Me.F_MOHZPreviewWindow.Form.Filter
End If
CurrentDb.CreateQueryDef "Q_SHPreview_01"
Set Qdf = CurrentDb.QueryDefs("Q_SHPreview_01")
Qdf.sql = strSQL
Qdf.Close
Set Qdf = Nothing
DoCmd.OutputTo acOutputQuery, "Q_SHPreview_01", acFormatXLS, , True
DoCmd.DeleteObject acQuery, "Q_SHPreview_01"
Exit_Command34_Click:
Exit Sub
Err_Command34_Click:
Select Case Err.Number
Case 3012
Resume Next
Case Else
MsgBox Err.Number & " " & Err.Description
Resume Exit_Command34_Click
End Select
End Sub
直接点导出可导出所有数据,也可点前面筛选导出部份数据,现在不筛选是默认导出所有数据,但点导出时提示:2306 输出的行太多,超出了输出格式或 PO管理系统 所做的限制.