Results 1 to 3 of 3
  1. #1
    mkc80 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Apr 2012
    Posts
    56

    Code to get the results of two different queries in access in to one sheet in an xls

    Can someone please provide me with the code to export the result of two different queries in access in to just one sheet in an Excel WorkBook?
    Like for example if I have two columns from query-1 and two columns from query-2, I want the result in say from cells A2:B100 and then D2:E100.

    And also may be provide a header (label) on top of both of the results in Excel Sheet?

    I am a newbie, so would need detailed instructions is possible. Thanks!

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    Can those two queries by joined in another query?

    You want an additional header row above the 4 columns? The export wizard or TransferSpreadsheet method could not do that. Would need VBA code to modify the spreadsheet.

    Review this thread discussing methods of exporting to Excel http://forums.aspfree.com/microsoft-...el-413629.html

    And about modifying the Excel worksheet https://www.accessforums.net/showthr...c-Excel-format
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    mkc80 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Apr 2012
    Posts
    56
    Yes you are right...Thank you for the links..

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

Similar Threads

  1. Replies: 1
    Last Post: 05-01-2012, 03:52 AM
  2. Replies: 3
    Last Post: 01-02-2011, 07:17 PM
  3. Replies: 1
    Last Post: 07-10-2010, 09:56 PM
  4. Replies: 3
    Last Post: 05-21-2010, 03:57 PM
  5. Different results in queries
    By Vic in forum Programming
    Replies: 6
    Last Post: 11-06-2009, 10:58 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