Results 1 to 7 of 7
  1. #1
    jo15765's Avatar
    jo15765 is offline Expert
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2010
    Location
    6 Feet Under
    Posts
    672

    Macro Or VBA


    I have a database that is all based off queries/macros. For example, on a button press event a macro will fire, that runs 4 queries. Running these 4 queries usually takes around 15 minutes. Would this process be any faster if I altered the macro and set everything to run through VBA? Or would the speed be to comparable to even begin making the change? Thoughts?

  2. #2
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    If all the macro does is to run those 4 queries, I doubt there is anything to be gained by converting the macro to VBA. It is the queries themselves that are taking the time, not the macro, and changing to VBA wouldn't change that.

  3. #3
    jo15765's Avatar
    jo15765 is offline Expert
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2010
    Location
    6 Feet Under
    Posts
    672
    @John_G - thank you for the response. I did not think so, but was unsure so thought I would ask before I began spending time to convert aimlessly.

  4. #4
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2013 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Most everyone on this forum will tell you VBA, we are not fans of macros. Speed differential - not really. The speed of queries depends on a lot of things, mostly which tables (local/linked) and how many functions are being used.

  5. #5
    jo15765's Avatar
    jo15765 is offline Expert
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2010
    Location
    6 Feet Under
    Posts
    672
    @aytee111 - they are linked tables from SQL Server. No functions are being used. Two are append queries and two are update queries.

  6. #6
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2013 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Yes, that will slow things down, even worse if they are depending on network availability.

  7. #7
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2013 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    If the speed is a concern for you and if all the queries use the same table(s), you may be able to bring the data over first, put it in a local table and run your queries off that.

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

Similar Threads

  1. Replies: 5
    Last Post: 09-19-2016, 01:35 PM
  2. Replies: 1
    Last Post: 01-21-2015, 02:02 PM
  3. Replies: 1
    Last Post: 01-13-2015, 01:33 PM
  4. Replies: 2
    Last Post: 05-05-2012, 02:34 AM
  5. Replies: 0
    Last Post: 01-12-2011, 12:43 PM

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