[AccessD] Cross post - looking for way to reassociate controls with events

Gustav Brock gustav at cactus.dk
Wed Jun 3 10:03:58 CDT 2015


Hi Bill

That was in March:

f you on a form decide to move some controls into a tab control, you normally do a cut and paste of these controls - from the form into a page of the tab control.

Then all the events of the controls get cleared; the [Event Procedure] markings are gone and the code behind is detached though still present.

To restore these settings, open the code module of the form:

1. Mark all code with Ctrl+A
2. Cut it away with Ctrl-X
3. Select menu Debug, Compile
4. Paste all the code back into the empty module with Ctrl-V
5. Select Debug, Compile

Now your event procedures are hooked up again.

I knew of this little trick but had forgotten the details and found it here after much searching:

     http://bytes.com/topic/access/answers/632851-detached-event-procedures

/gustav

-----Oprindelig meddelelse-----
Fra: AccessD [mailto:accessd-bounces at databaseadvisors.com] På vegne af Bill Benson
Sendt: 3. juni 2015 16:51
Til: Access Developers discussion and problem solving; Microsoft Access Database Discussion List
Emne: [AccessD] Cross post - looking for way to reassociate controls with events

Not long back on one of the lists, someone posted some great technique for re-associating controls with the event code (such as Click) in the form code module, when controls have been cut and pasted. I recently moved all my controls from the form to within the page of a tab control on the parent form. This caused all the event code to no longer be registered and I need that trick to get the associations back because there really is no other way besides re-selecting the events after inspecting the code by hand.

Thanks. 



More information about the AccessD mailing list