Office中国论坛/Access中国论坛
标题:
[求助]导出到EXCEL的数据如何按时间排列?
[打印本页]
作者:
onlyfish
时间:
2005-9-29 02:14
标题:
[求助]导出到EXCEL的数据如何按时间排列?
我用下面的代码,导出到EXCEL,可导出的数据没有按时间排列,要怎么做呀???
Private Sub OUTPUT_Click()
On Error GoTo Err_OUTPUT_Click
Dim qdf As DAO.QueryDef
Dim strWhere, strSQL As String
strWhere = Me.VAS_REPORT_Query_subform.Form.Filter
If strWhere = "" Then
strSQL = "SELECT * FROM [VAS REPORT Query]"
Else
strSQL = "SELECT * FROM [VAS REPORT Query] WHERE " & strWhere
End If
Set qdf = CurrentDb.QueryDefs("QueryRESULT")
qdf.SQL = strSQL
qdf.Close
Set qdf = Nothing
DoCmd.OutputTo acOutputQuery, "QueryRESULT", acFormatXLS, , True
Exit_OUTPUT_Click:
Exit Sub
Err_OUTPUT_Click:
MsgBox Err.Description
Resume Exit_OUTPUT_Click
End Sub
作者:
honghao
时间:
2005-9-29 17:41
STRSQL = STRSQL & "order by 时间"
欢迎光临 Office中国论坛/Access中国论坛 (http://www.office-cn.net/)
Powered by Discuz! X3.3