Code:
Private Sub Command3_Click()
Dim reportName As String
Dim theFilePath As String
'' On Error Resume Next
Select Case Me.Frame4.Value
Case 1
reportName = "Query1"
Case 2
reportName = "Query2"
End Select
theFilePath = "C:\Documents and Settings\" & Environ("UserName") & "\Desktop\"
theFilePath = theFilePath & reportName & ".xlsx"
DoCmd.TransferSpreadsheet acExport, 10, reportName, theFilePath, True
MsgBox "Check your Desktop."
End Sub
Running the above code on a button. Is it possible to add options to the export to tell it a particular sheet and/or particular rows and columns.
Thanks,