Fordraiders
asked on
exporting data and filtered data from a subform
exporting data from subform
I have used this code in 2010 and 2003 to export a subform and even if the subform had filtered records, it ONLY exported the filtered data ?
Now it does not in Office 365 ?
DoCmd.DeleteObject acQuery, "qryTemp"
Set qdf = CurrentDb.CreateQueryDef(" qryTemp", Me.All_ExtendedPaymentTerm s_subform. Form.Recor dSource)
DoCmd.OutputTo acOutputQuery, "qryTemp", acFormatXLS, "C:\Users\" & Racfid & "\Desktop\All_Extended.xls ", True
I have used this code in 2010 and 2003 to export a subform and even if the subform had filtered records, it ONLY exported the filtered data ?
Now it does not in Office 365 ?
DoCmd.DeleteObject acQuery, "qryTemp"
Set qdf = CurrentDb.CreateQueryDef("
DoCmd.OutputTo acOutputQuery, "qryTemp", acFormatXLS, "C:\Users\" & Racfid & "\Desktop\All_Extended.xls
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks dale
glad I could help.
ASKER
This worked also:
If Me.Dirty Then Me.Dirty = False
Dim rsClone As DAO.Recordset
'Set rsClone = Me.All_ExtendedPaymentTerm
If Me.TabCtl0.Value = 0 Then
Set rsClone = Me.All_ExtendedPaymentTerm
End If
If Me.TabCtl0.Value = 1 Then
Me.National_Account_View_s
End If
If Me.TabCtl0.Value = 2 Then
Me.Government_View_subform
End If
If Me.TabCtl0.Value = 3 Then
Me.Commercial_Manufacturin
End If
If rsClone.EOF Then
MsgBox "No records found."
Set rsClone = Nothing
Exit Sub
End If
Dim xlApp As Object
Set xlApp = CreateObject("Excel.Applic
With xlApp
.Visible = True
.Workbooks.Add
.Sheets("Sheet1").Select
.ActiveSheet.Range("A2").C
For i = 1 To rsClone.Fields.Count
xlApp.ActiveSheet.Cells(1,
Next i
xlApp.Cells.EntireColumn.A
End With