Invisible macro

J

John

Hi

I have a fairly complex form with many sub forms and then sub forms within.
When I close the form a macro is run. I for the life of me can not find were
on the form is this macro run from so I can disable it. I tried doing a text
search on macro name but no luck. Is there a way to catch where this macro
is being called from on the form?

Thanks

Regards
 
J

Jerry Whittle

Are you sure that it's a macro and not a function or sub in a module or
within a form?

What does it do?

No matter what, it almost has to be fired by an event in the form. Do a Ctrl
+ g to bring open the VBA window. You can then click on the forms in the
Project Window to see what functions or subs are fired by events. It could be
in the main form, subforms, or sub-subforms.

If you can't find it there, open each form or subform and bring up the
properties. Go to the events tab and see what is run. Then click on each
control on the form and see what events might have a macro assigned to them.
 
J

Jim Franklin

John, try this with first the main form and then each subform in turn...

Open the form in design view and bring up the Properties window. Make sure
that you are looking at the properties for the form itsself (the Properties
window will be titled "Form".) Click on the 'Event' tab and look for the
name of your macro, scrolling down if necessary. There are several events
which could be triggering your macro, such as 'On Close', 'On Unload' etc.

To de-activate the macro, simply clear its name from any event setting you
find it in.

Hope this helps!
Jim
 
Top