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.
Executable code not allowed in module level of a form
■ Visual Basic does not allow executable code at the module
level of a form module.
■ All statements are executable except:
COMMON CONST
DATA DECLARE
DEFtype DIM (for static arrays)
Metacommands OPTION BASE
OPTION EXPLICIT REM
SHARED STATIC
TYPE...END TYPE
■ Possible solutions:
• Move the executable statement to a SUB, FUNCTION, or event
procedure.
• Move the executable statement to the module level of a
non-form module.
• Delete the executable statement.
■ If you need additional help, move the cursor to a keyword
and press F1 to open the Help window.