ACCESS中EXCEL表格的导出
Private Sub Command85_Click() '生成EXCEL表
Dim exFile As String, Shellstg As String
'导出[XX中学摸底成绩]
DoCmd.TransferSpreadsheet acExport, 8, Me.Combo69 & "摸底成绩", CurrentProject.Path & "\" & Me.Combo69, False, ""
'导出[XX中学]成绩
DoCmd.TransferSpreadsheet acExport, 8, Me.Combo69, CurrentProject.Path & "\" & Me.Combo69, False, ""
'导出[XX中学摸底单科]
SQL = "Select " & Me.Combo69 & ".*"
SQL = SQL + " FROM " & Me.Combo69 & "摸底成绩 INNER JOIN " & Me.Combo69 & " ON " & Me.Combo69 & "摸底成绩.姓名 = " & Me.Combo69 & ".姓名"
SQL = SQL + " orDER BY " & Me.Combo69 & "摸底成绩.总分 DESC;"
'建立[XX中学摸底单科]查询
On Error Resume Next
Set qdf = CurrentDb.CreateQueryDef(Me.Combo69 & "摸底单科", SQL) '[XX中学摸底单科]
'导出[XX中学摸底单科]
DoCmd.TransferSpreadsheet acExport, 8, Me.Combo69 & "摸底单科", CurrentProject.Path & "\" & Me.Combo69, False, ""
DoCmd.Close
''请注意引号的用法
Shellstg = """c:\Program Files\Microsoft Office\OFFICE11\EXCEL.EXE"" """ & CurrentProject.Path & "\招生.XLS" & """"
Call Shell(Shellstg, 1)
End Sub
Word教程网 | Excel教程网 | Dreamweaver教程网 | Fireworks教程网 | PPT教程网 | FLASH教程网 | PS教程网 |
HTML教程网 | DIV CSS教程网 | FLASH AS教程网 | ACCESS教程网 | SQL SERVER教程网 | C语言教程网 | JAVASCRIPT教程网 |
ASP教程网 | ASP.NET教程网 | CorelDraw教程网 |