isladogs
MVP / VIP
- Local time
- Today, 09:35
- Joined
- Jan 14, 2017
- Messages
- 19,111
Prompted by an old thread at Stackoverflow, I thought it might be interesting for members to share features that are not widely known in VBA.
Here's a couple to get started. If the thread gains traction, I may add some more ....
1. Adding Option Private Module in the declarations section is used at module level to indicate that the entire module is private.
This means module-level parts not declared Private are available to other modules in the project, but not to other projects or applications.
This has another benefit in that it can be used to fully hide details of constants, variables and procedures in an ACCDE file.
When an ACCDE file is created, the module code is no longer available to view or edit.
However, a lot of information can still be seen in ACCDE files including a list of procedures and values of any constants that have been defined.
To prevent this, you can add the line Option Private Module to any standard or class module.
For more details, see https://www.isladogs.co.uk/vbe-option-statements/
2. Pressing Ctrl+T whilst in the VBE brings up an archaic Components dialog. Its in all versions of Access though apparently of little use.
Which little known / little used features of VBA would others like to share?
Here's a couple to get started. If the thread gains traction, I may add some more ....
1. Adding Option Private Module in the declarations section is used at module level to indicate that the entire module is private.
This means module-level parts not declared Private are available to other modules in the project, but not to other projects or applications.
This has another benefit in that it can be used to fully hide details of constants, variables and procedures in an ACCDE file.
When an ACCDE file is created, the module code is no longer available to view or edit.
However, a lot of information can still be seen in ACCDE files including a list of procedures and values of any constants that have been defined.
To prevent this, you can add the line Option Private Module to any standard or class module.
For more details, see https://www.isladogs.co.uk/vbe-option-statements/
2. Pressing Ctrl+T whilst in the VBE brings up an archaic Components dialog. Its in all versions of Access though apparently of little use.
Which little known / little used features of VBA would others like to share?