O'Reilly logo

Access™ 2007 VBA Programmer's Reference by Armen Stein, Geoffrey Griffith, Rob Cooper, Teresa Hennig

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required