An event is something that happens to an object. The car turns when you move the wheel. The horn blares when you press it. The door closes when you pull it. Turning, blaring, and closing are all events of the car. You might be wondering what the difference is between an event and a method. Well, they are definitely related. An event happens when the user does something. The actual doing is the method. So you invoke the move method on the wheel and the car invokes the turn event. Make sense? We hope so. If not, we'll examine the same relationship between the methods and events of an Access form.

When you open an Access form, you actually raise (or cause to happen) the OnOpen event. When you close the form, you raise the OnClose event. Within code, however, you can invoke the Open method of the form. Invoking the Open method causes the OnOpen event to fire. So, invoking a method causes an event.

Now that you know a bit about properties, methods, and events, we'll review briefly the fundamentals of VBA programming.

Was this article helpful?

0 0

Post a comment