Results 1 to 3 of 3
  1. #1
    dumbledown is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Feb 2012
    Posts
    46

    macro running in order

    Hi,


    I have a form with three buttons on it, which all carry out processes using queries and code. These buttons are pressed in order and all work perfectly.
    I want to create a button that consolidates these buttons (Button_ALL) - so Button_1 runs, then Button_2, then Button_3.
    However, when copying the various components for these buttons sequentially into a new macro - that Button_ALL calls, it runs the 3 buttons together and the results produced are wrong - it hadn't finished running one of the queries for Button_2 before running the macros in Button_3.
    How can I get everything to run in order?

    I hope that stream of consciousness makes sense?!
    Thanks
    Hugh

  2. #2
    Evilferret is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2012
    Posts
    27
    Please post code for each of the three buttons. Hard to say without seeing your code.

  3. #3
    dumbledown is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Feb 2012
    Posts
    46
    Thanks Evilferret, I guess that would help.
    Hew you go:

    The macro is:

    RunCode getdatalinks()
    RunCode combinelinks()
    OpenQuery averagelinks,Datasheet,Edit
    RunMacro link nodes from model,,
    RunMacro results to links,,

    The issue is when carrying out the OpenQuery it hasn't finished but still runs the two following macros.

    If it helps the query is this:

    SELECT newlinks.[On Link] AS link, Avg(newlinks.SumOfCount) AS [Count], Avg(newlinks.[Length (m)]) AS [Length (m)], Avg([SumOfLink Time (s)]/[SumOfCount]) AS [Time (s)], Avg(newlinks.Speed) AS AvgOfSpeed, 1 AS control
    FROM newlinks
    GROUP BY newlinks.[On Link], 1;

    Cheers!

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

Similar Threads

  1. running macro in another DB
    By AdrianoG87 in forum Import/Export Data
    Replies: 1
    Last Post: 09-30-2011, 12:31 AM
  2. Replies: 11
    Last Post: 07-08-2011, 02:12 PM
  3. Running an Update Query from a Macro
    By michaelb in forum Queries
    Replies: 7
    Last Post: 06-02-2011, 09:46 PM
  4. Running module from Macro
    By Harley Guy in forum Modules
    Replies: 6
    Last Post: 10-27-2010, 11:05 AM
  5. Running a VB function in a Macro
    By JuuJuu in forum Access
    Replies: 1
    Last Post: 10-27-2009, 02:50 AM

Tags for this Thread

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