Results 1 to 2 of 2
  1. #1
    ck4794 is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Oct 2013
    Posts
    80

    Queries vs VBA DoCmd.RunSQL

    So as I'm coming on board with using VBA as opposed to MACROS, I'm also discovering how to write SQL. So here's my question:



    Is there an advantage to creating a query instead of using DoCmd.RunSQL in a VBA module?

    I've managed to replace all my append, delete, and lookup queries. The only advantage I see so far, is on an action query, the option to see what results are going to be returned before actually running it. That and SQL view when I get confused on the language I need to use.

    Anybody Else want to weigh in on the subject?

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Static queries have a strategy built into them where dynamic queries need to develop that strategy before they run. This makes Static queries just a little bit faster along with the issues you already discovered.

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

Similar Threads

  1. DoCmd.RunSQL
    By Access_Blaster in forum Programming
    Replies: 6
    Last Post: 07-23-2013, 09:27 PM
  2. my first DoCmd.RunSQL
    By broecher in forum Programming
    Replies: 4
    Last Post: 11-05-2010, 09:35 PM
  3. docmd.runsql update
    By Mitch_Aus in forum Programming
    Replies: 2
    Last Post: 10-05-2010, 09:45 AM
  4. Problem with DoCmd.RunSQL
    By Peter01 in forum Programming
    Replies: 2
    Last Post: 09-10-2009, 07:11 PM
  5. docmd.runsql not working
    By Rameez in forum Programming
    Replies: 3
    Last Post: 08-07-2009, 10:07 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