Why Use CBF?
Why use CBF in your applications? For several reasons:
- You can better organize your code. The code for a form or report is tied directly to it. You don't need to search through many global modules to find the code that responds to a button click.
- You can use shorter syntax in the form or report module. The context of the owning form or report is passed in, so instead of saying: Forms!MyForm!MyControl, you can simply say MyControl.
- You can avoid global name space conflicts. Procedures in form or report modules are private to that module. There's no worry of conflicting with global procedures or procedures in other form or report modules.
- You can use the parameters passed by the events. Many of the events Microsoft Access fires contain parameters giving more information and options. You can only use these parameters with event procedures and CBF. They aren't available to macros or global functions.
This last point leads us into the next topic, the event model for Microsoft Access 2.0.