An event handler that executes VBA functions is one of the four types of event handlers that you can define for FORMS.
VBA functions can access information from the current context. For example, when FORMS is interpreting a particular form, a function can access individual fields on the form, the form itself and some information from the form definition. Other forms in the database are inaccessible.
When a VBA function is called, the block of code associated with the event handler is compiled and the function is called. VBA functions can call other VBA functions and can fire events of their own.
The internal VBA engine provides many features that can be used to customize FORMS. In addition to traditional language constructs, you can create dialogs, manipulate files, communicate using ActiveX automation, call functions in DLLs, and call several of the functions provided by the Win32 API.
What you cannot use the internal VBA engine for is advanced window handling, socket programming (Internet), and database communication (such as ODBC). For database communication, consider using an external event server object, a plug-in, or calling DLL functions. You can also let the event handlers communicate with ActiveX objects that implement the required functionality.
VBA functions access data through FORMS’ Application object (OLE API), or one of its five Application objects (COM API). The object provides access to more information such as forms, sets, and jobs. From a form object you can access the fields contained in a form. There are many types of objects that you can access from the application object.
You can pass parameters to a VBA function using ordinary VBA function syntax. To access FORMS data, you must obtain an object reference to FORMS via ActiveX automation.
You can also pass simple strings from one event handler to another.