form objects lose association with VBA code..

  • Thread starter Thread starter david rocha
  • Start date Start date
D

david rocha

I have a form with many objects, many of which have VBA code like
onclick, afterupdate, beforeupdate etc.

As I've been modifying the form, by adding many labels (no code
modifications of any kind), somehow, many of the controls on the form
have forgotten that they are supposed to run code. Looking at the
properties of the control, the "onclick" will be blank.. then if I
choose "event procedure" and the "...", it opens correctly, to the VBA
code browser showing the onclick event code, which is still there in
the VBA code where it should be, with all the other code.

Other than going to each form object, comparing it against the VBA,
and making sure it still has the proper VBA events associated with it,
is there a way to "rebuild" those associations automatically, by
reading the VBA code?

Is there a reason these controls have lost their associations, simply
from the process of adding labels to the form?
 
m:
Is there a reason these controls have lost their associations,
simply from the process of adding labels to the form?

I you cut and paste a control with an event, the pasted control does
not inherit the same events, even though it has the same name as
before.
 
David-W-Fenton said:
david rocha <[email protected]> who asked

If you cut and paste a control with an event,
the pasted control does not inherit the same
events, even though it has the same name as
before.

IIRC, the (free) MZTools (http://www.mztools.com/) includes a feature that
lets you copy Controls and their Event Code. FYI, I have no business
relationship with MZTools, but I do use their product.

Larry

Larry
 
Back
Top