G.19. Other Helpful Information
There's a lot of information about the Access object model in this appendix. In addition to the basic objects you'll manipulate on a daily basis, there are many other areas of the object model with which you should be familiar. You need to know some of the myriad arguments you can use with some of these objects, as well as the order in which events fire in the different objects. The following sections detail some additional information about programming in Access that may be helpful.
G.19.1. Order of Events
Knowing the order in which events fire is an important aspect of programming with VBA in Access. These order lists can help you decide which events you should choose for your applications. It's also essential to recognize that events do not necessarily fire when actions are triggered using VBA code. For example, if you set a value for a control programmatically, the AfterUpdate event for the control does not fire.
Events that begin with the prefix Before can typically be cancelled by setting the Cancel argument of the event to True.
G.19.1.1. Forms, Controls, and Subforms
Here's the order of events for the opening sequence of a form with controls:
Open->Load->Resize->Activate->Current->Enter (control)->GotFocus (control)
If there are no controls on the form, the GotFocus event will fire after the Current event. If there is an Attachment control on the form, the OnAttachmentCurrent event will fire before the Form_Current event (as long as it ...
Get Access™ 2007 VBA Programmer's Reference now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.