ener.hlp (Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
Event handler must be SUB procedure
■ Event handlers cannot return values and therefore cannot
  be defined as a FUNCTION. For example:
 
  ┌─Wrong────────────────────────────────────────────────┐
  │ FUNCTION Form_Click ()                               │
  └──────────────────────────────────────────────────────┘
 
  ┌─Right────────────────────────────────────────────────┐
  │ SUB Form_Click ()                                    │
  └──────────────────────────────────────────────────────┘
 
■ Possible solutions:
 
  • Use the SUB statement rather than the FUNCTION statement
    to define event procedures.
 
  • Choose Event Procedures from the Edit menu to use the
    Event Procedures dialog. When you use this dialog, Visual
    Basic creates the correct event procedure template for
    you.
 
■ If you need additional help, move the cursor to a keyword
  and press F1 to open the Help window.