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

Bill Benson bensonforums at gmail.com
Wed Jun 3 10:53:30 CDT 2015


>From the other list (Gustav):

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

Another (John Colby and Rocky Smolin):

Paste the even[t] code (back) in after moving the controls.



On Wed, Jun 3, 2015 at 10:51 AM, Bill Benson <bensonforums at gmail.com> wrote:

> 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