> ## Content Index
> Fetch the complete content index at: https://nolongerset.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# Evolution of a Function: ShowForm()
- URL: https://nolongerset.com/evolution-of-a-function-showform/
- Published: 2023-07-12T02:50:46.000Z
- Updated: 2026-05-08T12:34:11.000Z
- Description: Code is a living thing. Letting it grow organically over time helps ensure that you get exactly the features you need. My ShowForm() function is a prime example.
- Author: Mike Wolfe
- Tags: ShowForm, #todo, #Import 2026-05-20 02:59

*This is the introduction to a [series](https://nolongerset.com/tag/showform/) on the evolution of my ShowForm() function.*

- [*Part 1: Minimum Viable Product (MVP)*](https://nolongerset.com/showform-part-1/)
- *[Part 2: Multiple Form Instance Support](https://nolongerset.com/showform-part-2/)*
- *Parts 3+: (Not yet published)*

---

There are 4 keys to [building generic solutions in code](https://nolongerset.com/building-generic-solutions/):

1. Avoid premature generalization by sticking to the [Rule of Thrice](https://nolongerset.com/rule-of-thrice/)
2. Make sure any *additional* time spent building a generic solution is [worth it](https://xkcd.com/1205/)
3. Build only what you need at first; don't try to anticipate future use cases
4. Maintain backward compatibility as you add features

To illustrate points 3 and 4, I'm going to take you with me on a journey through the development of one of the foundational building blocks of my Access applications: my `ShowForm()` function.

## The ShowForm() Function

At its most basic, the ShowForm function acts as a wrapper around the built-in `DoCmd.OpenForm` method.

Over time, the function grew to encompass the following features:

- Simplify calling code by eliminating the *View* and *FilterName* arguments
- Avoid "Syntax error (missing operator) in query expression 'MyField = '." errors
- Force-apply new filter criteria to already-open forms\*
- Restore the form being opened if it is currently minimized\*
- Reveal the form being opened if it is currently hidden\*
- Support multiple form instances *with no change to the calling code*
- Avoid creating duplicate form instances (based on *WhereCondition* and *OpenArgs* arguments)
- Automatically cascade multi-instance forms (to avoid obscuring other instances of the same form)
- Return the window handle of the newly opened form (to track specific *instances* of a multi-instance form)

\* *NOTE: Features with asterisks in the list above appear to be built into the latest versions of Access, though I swear they were missing in earlier versions (e.g., Access 2000).*

Through a series of follow-up articles, I will show you how this function evolved and grew over a period of several years. 

From its humble beginnings to its current grandeur, this function is a great example of the power of Just-In-Time development mixed with [reverence for backwards compatibility](https://nolongerset.com/reverence-for-backwards-compatibility/).

## The Value of Version Control

I should point out the thing that makes this article series possible is my long and consistent use of version control to maintain my code library:

[Scraps of Wood and CodeResisting the packrat mentality.![](https://nolongerset.com/favicon.png)No Longer SetMike Wolfe![](https://storage.ghost.io/c/eb/d7/ebd732c1-5f03-4f07-b386-5d08557e15c9/content/images/2020/10/brush-wood-4536227_1920.jpg)](https://nolongerset.com/scraps-of-wood-and-code/)

Without version control, I'd be able to show you the code for the function as it is now, but I would have no way to show you how it evolved over time. Being able to see how code evolves is a powerful way to gain insight into why a piece of code works the way it does. 

*Image modified from [Wheel of Fortune template](https://www.kapwing.com/explore/wheel-of-fortune-template) on Kapwing.com*