I think one of the most underutilized methods for developers is the Print method! Beyond which, those that do use it often don’t necessarily use it to its full potential.
Did You Know?
Did you know the Print method actually has parts (options) that you can use? Most developer don’t.
What Is The Print Method?
The print method allow us to output (or ‘print’) information/values/content to VBA/VBE the Immediate Window.
How Is That Useful?
I know developers that don’t see the utility of Print when they have MsgBox, but they serve 2 distinct purposes.
MsgBox is more for the end-user, to display a message to them. Sadly, you can interact with a MsgBox. Amongst other things, you can’t copy the contents.
Print is only for the developer as it is displayed in the VBE Immediate Window. The beauty here is:
- that you can copy/paste its content which is great to search up those error numbers/descriptions.
- use it while in the VBE creating code without having to switch back and forth to the Access GUI and VBE windows
- using the options, and other techniques, you can format the output.
- you can sprinkle it throughout procedure to see the evolution of variables, … in real-time. This is great for debugging purposes.
Continue reading →