Archive Collection: Design Functions

I'm on vacation (shh...don't tell anyone)! I'll be back soon, but until then enjoy today's curated collection of articles from the archive. Today's topic: Design Functions.

Archive Collection: Design Functions

I've been writing a daily article here since September 1, 2020; that's over 1,200 articles.  I haven't missed a day yet, and that includes Christmas and Easter. I'm currently on a family vacation, which makes maintaining this streak a bit...tricky.

I'm writing this in the present tense, but I'm writing it for future publication with links to past articles.  Let's hope the time-space continuum holds up.

In any case, as the slacker Firstie says to the Stony Lonesome Gate guard twenty minutes before Taps, let me get to the Point.  I've got a daily publishing streak to keep up.  But I don't want to be writing and publishing articles on vacation.  And I still want to provide you with something of value to read each day.  So I settled on creating a series of curated article lists that I think you'll find beneficial.

I'm hoping at least some of these articles are ones you haven't read before.  And if you're so obsessed with me that you have read all my articles, I'm hoping that they'll keep you busy enough that you don't come looking for me and my family 😳.  

Enjoy!


Design Functions

These articles cover various routines that are meant to be used by the developer at design time to speed up (or otherwise improve) the development process.

Python-inspired Doc Tests in VBA
Doc tests are not a replacement for unit or integration testing. But they do provide the best return on investment (ROI) of any type of test, mostly because the effort to write them is near zero.
Poor Man’s Status Bar in VBA
If you’re looking for a quick and dirty way to keep track of a long-running process while developing, this VBA one-liner will do the trick.
How to Set a Breakpoint Inside of an Access Query
Did you ever want to set a breakpoint inside of an executing query? How about inside a form event property? This trick lets you do it.
Listing External Table Sources
Using the Parse() function to list linked tables by source. Use this when you want to refer to Linked Table Manager info while writing code.
ListFields() Part 1: Listing Table Fields in the Immediate Window
An easy way to reduce context switching between the VBA IDE and the Access application window is to list table field names in the immediate window.
Converting VBA Long Color Values to RGB
The VBA RGB() function converts red, green, and blue values into a VBA long integer color value. This simple function works in the other direction.
LogToTempFile() Function
A quick and dirty method for debugging large strings in VBA.
Set Report Properties in Bulk
Looking to set a report property, such as an event handler, to the same value for multiple reports? Use this routine to automate the whole process.

Generating Code

Writing boilerplate code is tedious, prone to silly mistakes, and difficult to maintain if you have to change the underlying logic.   It's also a necessary evil in VBA.  One way to avoid these downsides–especially the last one–is to automate the generation of the boilerplate code.

This section includes articles that will help you automate the generation of boilerplate VBA code.  The first and third articles are my personal favorites.

For additional related articles, check out the CodeGeneration Routines section of my Code Library.

Strongly-Typed Collections: The Easy Way
Creating a strongly-typed collection class in VBA requires jumping through code export-import hoops. What if you didn’t have to, though?
SetPredeclaredId(): Change the Hidden PredeclaredId Attribute of a VBA Class Module
This simple function overcomes the lack of a hidden attribute editor for PredeclaredId values in the VBA development environment.
VBA Code Generation Trick
Using Notepad++ to transform existing code into a VBA string that generates itself.
Writing Code with Code in VBA
Can you write code with code in VBA? Yes. Should you write code wit--OH, BE QUIET YOU!!! Where’s your sense of adventure? ;-)
Writing Boilerplate Code by Hand is for Suckers
Writing repetitive code may be a necessary evil in VBA, but it’s a lot less tedious if you generate most of it in VBA itself.
Create a Class Module from a String in Microsoft Access
Generate VBA class modules from strings during design time using this simple function in Microsoft Access.
GenerateTVClass(): Auto-Create a TempVars Class Module
The culmination of my TempVars series, this article shows you how to generate a TempVars class module from a local table.

Additional Reading

Code Library
Building Your LibraryThirteen years ago, I chose to maintain a folder of textfiles rather than a single Access database library. I’ve never once regrettedthat decision.No Longer SetMike Wolfe [https://nolongerset.com/building-your-library/]TheDependency TrainLet’s torture a train metaphor to illu…

All original code samples by Mike Wolfe are licensed under CC BY 4.0