Questions seem to perennially surface in this and other forums about control events not firing. The most common solution (and, in many contexts, the correct one) is that events are only triggered by user-interaction, not when controls are manipulated by VBA code. However, I have encountered a different situation and solution, one that I think is worth posting about.
I had a form that was working perfectly, but because the Details section was very crowded, I moved some controls into the Header section. When I checked in the VBA IDE, all the event procedure code was still there and was still associated with the control's section within the editor (I.e., it was not being seen as a general procedure unassociated with a control). However, when I tested the form, none of those controls' events could be triggered by my actions.
Solution: When I looked at the Events properties list for any of the affected controls, it was empty.
The controls themselves had lost their connection to the VBA procedures, and I had to relink them one by one, by the following steps:
I had a form that was working perfectly, but because the Details section was very crowded, I moved some controls into the Header section. When I checked in the VBA IDE, all the event procedure code was still there and was still associated with the control's section within the editor (I.e., it was not being seen as a general procedure unassociated with a control). However, when I tested the form, none of those controls' events could be triggered by my actions.
Solution: When I looked at the Events properties list for any of the affected controls, it was empty.
- Click the three-dots icon on the property to be relinked
- Select the Code Builder option.
- Click OK.
- The code editor window immediately updates to show the pre-existing code, now properly linked to the control.