• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 28. Responding to Events with VB... > Using Functions to Respond to Events

Using Functions to Respond to Events

You can create your own Main Switchboard form by adding additional command buttons to the form for opening other forms. It's much more efficient, however, to use a single procedure to perform a set of identical tasks in which only the name of the form changes. Minimizing the amount of code in a form speeds opening of the form and minimizes the size of your database file.

Access lets you call a function and pass one or more parameter (argument) values to the function in response to events. A function (not a subprocedure) is required, despite the fact that Access disregards the return value, if any, of the function. Control Wizards won't write the function code for you, nor will the Code Builder create a function stub. You must write the function yourself before calling it from an event. The OpenForms function in preceding Listing 28.1 is an example of using a function as an event handler.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint