raziel3
Registered User.
- Local time
- Yesterday, 22:10
- Joined
- Oct 5, 2017
- Messages
- 316
With a form's recordset, How to export the current viewed recordset. I am using this code but it includes all the form's unbounded fields in the export.
Also the underlying recordset has about 10 fields, I only want 4 of them exported.
Code:
Private Sub bntEXPORT2EXCEL_Click()
Dim Path As String
Dim FileName As String
FileName = InputBox("Enter File Name to Save As. (Will be placed on the Desktop)", "Create File")
Path = Environ("USERPROFILE") & "\Desktop\"
DoCmd.OutputTo acOutputForm, "Search", acFormatXLS, _
Path & FileName & ".xls"
End Sub
Also the underlying recordset has about 10 fields, I only want 4 of them exported.