Page 2 of 2 FirstFirst 12
Results 16 to 18 of 18

Export Filtered Form with associated Subform results to excel

  1. #16
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    8,149
    The dB in Post #14 is corrupt. There were form code modules but the forms were deleted.
    I managed to copy the code for form "USED_Form_Main" from the previous dB (Post #12) and paste it into the form "USED_Form_Main" in the dB in Post #14.


    It appears that your export code is working correctly.

    I think I mislead you. This line uses a parameter for A2010- 2016


    Code:
        DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12Xml, strcExportQuery, strFile
    For A2007, use this line
    Code:
        DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12, strcExportQuery, strFile
    Again,
    acSpreadsheetTypeExcel12 is for A2007
    acSpreadsheetTypeExcel12Xml is for A2010 - 2016.


    Are you still having problems?? Here is the Excel file that was created when I filtered by "9HB".
    Attached Files Attached Files
    HTH
    -----
    Steve
    --------------------------------
    "Veni, Vidi, Velcro"
    (I came; I saw; I stuck around.)

  2. #17
    mindbender is offline Competent Performer
    Windows XP Access 2007
    Join Date
    May 2013
    Posts
    244
    Quote Originally Posted by ssanfu View Post
    The dB in Post #14 is corrupt. There were form code modules but the forms were deleted.
    I managed to copy the code for form "USED_Form_Main" from the previous dB (Post #12) and paste it into the form "USED_Form_Main" in the dB in Post #14.


    It appears that your export code is working correctly.

    I think I mislead you. This line uses a parameter for A2010- 2016
    Code:
        DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12Xml, strcExportQuery, strFile
    For A2007, use this line
    Code:
        DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12, strcExportQuery, strFile
    Again,
    acSpreadsheetTypeExcel12 is for A2007
    acSpreadsheetTypeExcel12Xml is for A2010 - 2016.


    Are you still having problems?? Here is the Excel file that was created when I filtered by "9HB".
    The code appears to be right and the export appears to run but my spreadsheet is always blank. DO you have a way of receiving a 15mb zip file. I could send you the whole db without modifying it to see if you see something in its native form

  3. #18
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    8,149
    You could use something like "Dropbox" or "Box" and PM me a link to the file........
    I have a confuser at home with Windows XP Access 2007 on it, so I could test it there.
    HTH
    -----
    Steve
    --------------------------------
    "Veni, Vidi, Velcro"
    (I came; I saw; I stuck around.)

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Export Filtered Form to Excel
    By wizzz_wizzz in forum Import/Export Data
    Replies: 2
    Last Post: 11-24-2016, 06:21 PM
  2. Can't export data in a filtered subform only
    By mayestom in forum Macros
    Replies: 30
    Last Post: 08-11-2014, 08:23 AM
  3. Exporting filtered results to Excel
    By doublec9 in forum Import/Export Data
    Replies: 2
    Last Post: 06-04-2013, 08:05 PM
  4. Export Filtered Query to Excel Using Combo Box on Form
    By besuchanko in forum Import/Export Data
    Replies: 0
    Last Post: 02-07-2013, 09:10 PM
  5. Export Filtered Results to Excel Tabs
    By opod in forum Programming
    Replies: 1
    Last Post: 08-03-2011, 12:33 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Tech Forums: Microsoft Office Forums