Results 1 to 4 of 4
  1. #1
    esh112288 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2012
    Posts
    14

    Exporting Query Results to Excel at the Press of a Button

    I currently have a button that runs a query I've written. Rather than run the query and open the results in Access, I'd like for those results to automatically export to Excel. I have very little programming experience and am not sure how to make this happen. Any help would be appreciated.

  2. #2
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    You can use a Macro to do that. Take a look at the TransferSpreadsheet macro action. It explains each argument in detail, and if you press F1, you will get Advanced Help.

  3. #3
    alcapps is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Jan 2012
    Posts
    292
    there is a vba.. docmd. as well

    docmd.TransferSpreadsheet

    check that out..

  4. #4
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    there is a vba.. docmd. as well

    docmd.TransferSpreadsheet

    check that out..
    Its the same command that the Macro uses. The advantage with the macro is that you do not need to know VBA. The advantage with VBA is you can make it more dynamic.
    One great tool is the utility that "Converts Macros to Visual Basic". You can start with a basic macro. Then, if you use that utility to convert it to VBA, it will convert it to the VBA code you need. You can then edit the VBA code if you want to make it more dynamic.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Exporting Query results to Excel with VBA
    By Tomlon in forum Programming
    Replies: 1
    Last Post: 01-29-2013, 09:56 PM
  2. Replies: 3
    Last Post: 11-28-2012, 10:51 PM
  3. Exporting Report to Excel via Command Button
    By need_help12 in forum Import/Export Data
    Replies: 3
    Last Post: 04-24-2012, 03:27 PM
  4. Press a button to combine two fields to open a PDF
    By Douglas Post in forum Programming
    Replies: 4
    Last Post: 02-11-2012, 02:02 PM
  5. Exporting Query Results to an existing Excel Workbook
    By Dnphm in forum Import/Export Data
    Replies: 3
    Last Post: 07-13-2010, 11:40 AM

Posting Permissions

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