riktek
Member
- Local time
- Today, 07:53
- Joined
- Dec 15, 2023
- Messages
- 83
This question is either dumb with an obvious answer, or arcane and deeply into the weeds, I'm not certain which, about event progression among forms, subforms, and controls. Of course, I already have made extensive reference to the Access object model and the MS article Order of Events for Databasee Objects but they and my Google-fu have yet to reveal any understanding.
I'm working on optimizing form load times and am parsing event progression for forms and subforms to find ways to defer or avoid execution. I'm encountering undocumented behavior that I expect has a reasonable, if unintuitive, explanation and thought I'd seek clarification here.
The first question, or observation, is that the event progression when opening a form is documented as being:
Open > Load > Activate > Current
but in fact is:
Open > Load > Activate > Current > Deactivate > Activate > Current
Specifically, I'm wondering why Activate and Current reiterate, which may be partly about what triggers the Deactivate event, because nothing documents, describes, or explains this behavior. Obviously, I'd like to avoid re-executing calls from those two event procedures. I can engineer a kluge but does a means exist to interrupt the event progression to avoid reiterating these events?
The second question concerns events of combo boxes on subforms. The specific configuration has the SubForm controls on TabControl pages configured for lazy loading, i.e., SourceObject, LinkMasterFields, and LinkChildFields are conditionally assigned (or cleared) depending on whether the tab page is current / active / visible. I understand that setting any of these three properties causes SubForm.Form to reload. I also observe the same reiteration of Activate and Current.
What's different from the top form / main form case and what I don't understand, is that on each instance of SubForm.Form.Current, the combo box (but not text box) Enter and GotFocus events also are triggered. I'm keenly interested in interrupting this seemingly inexplicable event progression, too, to avoid triggering each of these events altogether. Again, I can engineer a kluge but am wondering why these control events are triggered in the first place because nothing documents, describes, or explains this behavior, and how to avoid that.
Many thanks for any insights.
I'm working on optimizing form load times and am parsing event progression for forms and subforms to find ways to defer or avoid execution. I'm encountering undocumented behavior that I expect has a reasonable, if unintuitive, explanation and thought I'd seek clarification here.
The first question, or observation, is that the event progression when opening a form is documented as being:
Open > Load > Activate > Current
but in fact is:
Open > Load > Activate > Current > Deactivate > Activate > Current
Specifically, I'm wondering why Activate and Current reiterate, which may be partly about what triggers the Deactivate event, because nothing documents, describes, or explains this behavior. Obviously, I'd like to avoid re-executing calls from those two event procedures. I can engineer a kluge but does a means exist to interrupt the event progression to avoid reiterating these events?
The second question concerns events of combo boxes on subforms. The specific configuration has the SubForm controls on TabControl pages configured for lazy loading, i.e., SourceObject, LinkMasterFields, and LinkChildFields are conditionally assigned (or cleared) depending on whether the tab page is current / active / visible. I understand that setting any of these three properties causes SubForm.Form to reload. I also observe the same reiteration of Activate and Current.
What's different from the top form / main form case and what I don't understand, is that on each instance of SubForm.Form.Current, the combo box (but not text box) Enter and GotFocus events also are triggered. I'm keenly interested in interrupting this seemingly inexplicable event progression, too, to avoid triggering each of these events altogether. Again, I can engineer a kluge but am wondering why these control events are triggered in the first place because nothing documents, describes, or explains this behavior, and how to avoid that.
Many thanks for any insights.