Results 1 to 6 of 6
  1. #1
    schulzy175 is offline Advanced Beginner
    Windows 7 64bit Access 2016
    Join Date
    Oct 2017
    Posts
    98

    Running VBA SQL without query/table?

    I'm sure it is possible, but how would I run an SQL statement in VBA that copies the results to the clipboard rather than populate the results in a query or table? I am assuming I'll be using DAO in this case.

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    Please tell us more or show us your proposed SQL
    "
    run an SQL statement in VBA that copies the results to the clipboard
    "

  3. #3
    schulzy175 is offline Advanced Beginner
    Windows 7 64bit Access 2016
    Join Date
    Oct 2017
    Posts
    98
    I have no SQL typed up atm. But I do know that you can copy the recordset in excel and paste it.

  4. #4
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    before you send everyone off to do your research for you, have tried googling something along the lines of 'copy recordset to clipboard'

    If you can do it in excel then I would think it is doable in access - what code would you use?

  5. #5
    Gicu's Avatar
    Gicu is offline VIP
    Windows 8 Access 2013
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,101
    Is this what you're after?
    https://www.pcreview.co.uk/threads/c...board.2772619/

    Cheers,
    Vlad

  6. #6
    schulzy175 is offline Advanced Beginner
    Windows 7 64bit Access 2016
    Join Date
    Oct 2017
    Posts
    98
    Quote Originally Posted by Ajax View Post
    before you send everyone off to do your research for you, have tried googling something along the lines of 'copy recordset to clipboard'

    If you can do it in excel then I would think it is doable in access - what code would you use?
    I did do research, but found no results regarding my specific question. I always do as much research as I can before posting to avoid wasting anyone's time.

    Quote Originally Posted by Gicu View Post
    Is this what you're after?
    https://www.pcreview.co.uk/threads/c...board.2772619/

    Cheers,
    Vlad
    This will work. I can dissect each function. Thanks. I am probably going to void out "ms access" in future searches to expand results.

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

Similar Threads

  1. Replies: 2
    Last Post: 07-13-2016, 08:23 PM
  2. Running Query on only 1 row of table.. Criteria?
    By JMac in forum Database Design
    Replies: 5
    Last Post: 04-16-2012, 11:27 PM
  3. Replies: 6
    Last Post: 03-02-2012, 12:33 AM
  4. Running a make table query
    By rohini in forum Forms
    Replies: 5
    Last Post: 02-22-2012, 11:32 AM
  5. Running a query or table in a form
    By Katherine in forum Forms
    Replies: 1
    Last Post: 08-17-2011, 09:12 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