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