macro Order of Execution in 2000 (1 Viewer)

dcavaiani

Registered User.
Local time
Today, 04:56
Joined
May 26, 2014
Messages
385
I have a macro :

OpenForm
OpenQuery
OpenQuery


I want the queries to run AFTER the Form closes, but just the opposite occurs ?
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 02:56
Joined
Aug 30, 2003
Messages
36,127
Unless the form is opened in dialog mode, the queries will run immediately.
 

dcavaiani

Registered User.
Local time
Today, 04:56
Joined
May 26, 2014
Messages
385
I changed it to dialog mode on the OpenForm settings at the bottom of that line of that FIRST LINE of the Macro, but no change noted by doing so.
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 02:56
Joined
Aug 30, 2003
Messages
36,127
I don't use macros so perhaps the execution is different. In VBA code, the lines after opening a form in dialog mode won't run until the form is either closed or hidden.
 

johnb19

New member
Local time
Today, 02:56
Joined
Aug 23, 2013
Messages
9
To pbaldy...respectfully, is there anyone there who does use Macros? Some of us do not use VBC.
 

CJ_London

Super Moderator
Staff member
Local time
Today, 10:56
Joined
Feb 19, 2013
Messages
16,634
how about putting the openquery macros in the form close event
 

dcavaiani

Registered User.
Local time
Today, 04:56
Joined
May 26, 2014
Messages
385
I have macros that execute 7-10 other events - all under the one umbrella. Why would one NOT use something so easily nested??
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 02:56
Joined
Aug 30, 2003
Messages
36,127
Macros are certainly a good tool, but few professional developers use them. VBA offers much more power, flexibility, error handling, etc.
 

CJ_London

Super Moderator
Staff member
Local time
Today, 10:56
Joined
Feb 19, 2013
Messages
16,634
Why would one NOT use something so easily nested??
If you can't get it to work one way, try another. Like Paul, I don't use macros due to their limitations and difficulty in documenting and debugging, so was just a suggestion.

here is a link from 2007, which offers the original advice (and an old one of Pauls!)

http://www.dbforums.com/showthread.php?1620562-Pause-a-macro-to-fill-in-a-form

is there anyone there who does use Macros?
I'm sure there are but we are all volunteers, the majority of regular responders being professional developers who use VBA.

Take a look at a) the relatively few threads there are on macros v vba (3510 v 43277 at current count) and b) see if you can find any examples in the code repository or sample databases which use macros to form an opinion.

But a good question to put on the watercooler to see what the response is
 

Users who are viewing this thread

Top Bottom