Compile button you ask? Then you say “But I always have to go Debug and Compile Project.” and “Sometimes I don’t even think of it.”
When in the VBA IDE I always have the debug menu visible. I put it on the right hand side of the Standard Menu. I then added the compile button to the Debug menu.
Do make very sure that you have the Require Variable Declarations check box on. You get there from within the VBA Editor by Tools >> Options >> Editor tab. Access 2000 in particular turns this off.
This once cost me an hour of wasted effort while doing a very high pressure database on site during the last few weeks of building what was at that time North America’s largest every construction project. It never occurred to me to look for Option Explicit not being present at the top of the VBA module. GRRRR. Fortunately MS turned that option back on in Access 2002 as I recall.
While you’re there I always turn the Auto Syntax Check off as every line that has a compile error gives you an annoying message box. You should see the red line of code with an error. But if you don’t then hitting the compile project button will show you the lines of code with errors.
And yes, that is MZ-Tools on the lower left hand side.
I find that working with the Toolbars to be quite non intuitive but I’m getting a bit better at it.
1) To add the Debug Toolbar right click anywhere on the ToolBar and select the Debug Toolbar. It will now be plopped (excellent techie term that) as a floating toolbar on your screen. Drag it to the existing Toolbar and to the right hand side.
While you’re there add the Edit Toolbar too as it has some nice features too especially the comment and uncomment buttons.
2) Right click anywhere on any ToolBar and choose Customize. The Toolbar on the right hand side will move to the left. This is only a temporary thing.
3) Click on the Commands Tab and click on the Debug Category in the left hand list box.
4) On the right hand list box you will see Compile Project as the first item. Drag and drop it onto the Debug menu.
5) Close and you’re done.
This was all done in Access 2000 so other versions of Access might be slightly different.
Thanks go to TechSmith for their free MVP license for SnagIt. Took me a minute or two to figure out the best way of snagging the toolbar but after that it was effortless. Nice user interface and quite easy to use. It was quite easy to add the red arrow too. And I’ve never used SnagIt before either. It was a lot less effort than using Ctrl+Print Screen, MS Paint to paste the image into and a graphics tool to resize the jpg.