+ Reply to Thread
Results 1 to 2 of 2

VBA Code to Import Access Query Results

  1. #1
    Forum Contributor pr4t3ek's Avatar
    Join Date
    10-13-2008
    Location
    Melbourne, Australia
    MS-Off Ver
    2003 & 2007, 2010
    Posts
    483

    VBA Code to Import Access Query Results

    Hi,
    I was wondering if anyone could provide me with code to execute a macro in excel which would execute an access query and copy the results to an excel worksheet. or possibly work sheets depending on how many records there actually are.

    I've got code to export to access but i need code to import access query results.

    Hope there is help out there =]
    Thanks in advance.
    Last edited by pr4t3ek; 10-15-2008 at 06:32 AM.
    --
    Regards
    PD

    ----- Don't Forget -----

    1. Use code tags. Place "[code]" before the first line of code and "[/code"]" after the last line of code. Exclude quotation marks

    2. Thank those who have helped you by Clicking the scales above each post.

    3. Please mark your post [SOLVED] if it has been answered satisfactorily.

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591
    Hi

    Try this.

    Please Login or Register  to view this content.
    The database is c:\temp\test.mdb
    and there is a query called qry_test1 in that database
    and it will put the output to A1 of the current sheet.

    If you are likely to get > 65k records from this query, is there any way you can break it down into smaller parts and bring back each part to a separate sheet? If not, then the only thing I can think of is to cycle through the records in the recordset and output each one, keeping a count of the output row and move to a new sheet, but that would take quite a while to process....


    HTH

    rylo

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Dynamic Field Name when Import into Access
    By pickledmuffin in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-22-2008, 10:13 PM
  2. Query Access from Excel - pass list?
    By sumdumgai in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-08-2008, 07:06 AM
  3. VB Code to Transpose & Import a Text File
    By Jdarris in forum Excel General
    Replies: 1
    Last Post: 01-08-2007, 10:49 PM
  4. Query Access based on date
    By Kinesthesia in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-17-2006, 01:04 PM
  5. import from access using wizard
    By ceemo in forum Excel General
    Replies: 3
    Last Post: 09-26-2006, 08:09 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1