Turning off macros

B

BillyJ

I have a question regarding two different macros.

One macro is a "prepopulate" type macro. It loops through a field and
prepopulates a number of fields with semi-random data.

However, the idea is that you can then go into a form and change a couple of
those fields if you need to make adjustments. There is a second macro that is
linked to the "On Change" event of that field that checks to make sure I
haven't entered a number that already exists in the field. But I dont want
that "check" macro to run while my prepopulate macro is running since it
already has that function built in.

Is there a way to temporarilly turn the "check" macro off while the
"prepopulate" macro is running.

Thanks so much in advance.
 
R

Rick Brandt

BillyJ said:
I have a question regarding two different macros.

One macro is a "prepopulate" type macro. It loops through a field and
prepopulates a number of fields with semi-random data.

However, the idea is that you can then go into a form and change a
couple of those fields if you need to make adjustments. There is a
second macro that is linked to the "On Change" event of that field
that checks to make sure I haven't entered a number that already
exists in the field. But I dont want that "check" macro to run while
my prepopulate macro is running since it already has that function
built in.

Is there a way to temporarilly turn the "check" macro off while the
"prepopulate" macro is running.

Thanks so much in advance.

Control values that are changed via code or macros don't trigger the Update
events for the control so you should be okay.
 
J

John Vinson

There is a second macro that is
linked to the "On Change" event

The name of this event is a bit misleading. It fires AT EVERY
KEYSTROKE - if you want the second macro to run after a new value has
been entered, use the AfterUpdate event instead.

As Rick says, either event will fire only when the field is modified
by the user - not by the other macro.

John W. Vinson[MVP]
 
G

Guest

and yes, FWIW, the condition field of the macro can reference
a form field, so you can turn macros on and off. Right click on
the macro Title Bar to see the menu that allows you to see the
conditions.

(david)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top