Skip to content
Auscultby NBIT
EN
Free diagnostic

In depth · Maintenance

The technical debt of Access and VBA applications

An Access application ages quietly. It keeps working, until the day an Office update, a new PC or its author's departure brings it to a halt. That accumulated fragility has a name: technical debt.

Source code on a screen

The term comes from software development: every shortcut taken to deliver faster (a hard-coded path, a copied-and-pasted query, a missing error check) is a loan. As long as nothing changes around the application, nothing is repaid. The day the environment moves, all the interest falls due at once.

Access applications are particularly exposed. They often start life as a stopgap, built by a power user rather than a development team, and then become indispensable. They go on to live through several Office versions, several generations of PCs and several successive maintainers.

The five most common forms of debt

In the Access applications we analyse, debt almost always takes the same forms. Some already cause failures; others are waiting their turn.

Part of that debt already shows in Access's own messages: Access and VBA errors, code by code, with their causes and fixes.

Form of debtWhat you seeWhat triggers it
Code written for 32-bit"Declare" statements without "PtrSafe", "Long" types for memory addressesInstalling 64-bit Office, now the default
Hard-coded paths"\\SRV01\Accounts\data.mdb", "C:\Export\" in the code or linked tablesA new server, drive letter or PC
Queries built by pastingUser input inserted between quotes in SQLA name like "O'Brien" or "D'Almeida"
Fragile references and librariesOld ActiveX controls, "MISSING" references, VBScript.RegExpA new PC, Windows components being removed
Abandoned objectsOrphan forms, queries never called, code commented "still used?"Any change: nobody dares delete anything

Why it stays invisible for so long

The technical debt of an Access application does not show in daily use: users always take the same paths, which work. The broken forms are the ones nobody opens any more, rare errors get worked around ("when it crashes, we close it and open it again"). And nobody reads the VBA code.

Three events bring it suddenly to light:

  • A new PC or Office version. The move to 64-bit, the disappearance of an ActiveX control or a reference is enough to stop the application opening. Our guide 64-bit Office and Access covers this case in detail.
  • The author leaving. What they used to fix from memory becomes a mystery, and every change becomes risky.
  • A migration project. The estimate is based on what can be seen; the debt is discovered afterwards, line by line.

Measure rather than guess

Debt is measured object by object. Reading the code is not enough: many flaws only show up when the application runs. A useful measurement combines two approaches:

  1. Read the application: an inventory of every object, an analysis of the VBA code (declarations, built-up queries, paths, references), and a list of objects nothing calls.
  2. Run it: open every form, run every query, print every report and click every button on a copy, recording the exact errors Access returns.
  3. Cross-check the two: a flaw read in the code and confirmed at run time is a certainty; a flaw read but never triggered remains to be verified.
The application's risks by category: security, longevity, data, debt
A real excerpt from an Auscult report: risks sorted by family and severity, each tied to an action in the plan.

Pay it back in the right order

Fixing everything makes no sense, especially if a migration is on the cards: a form that will not be carried over does not deserve repairing. The order that works in practice:

  • First, what breaks everyday use: failures on forms in use, 64-bit incompatibilities, dependencies on paths that are about to disappear.
  • Next, what exposes you: plain-text passwords, queries built by pasting, unprotected personal data. See our guide Securing an Access application.
  • Then the quick wins: removing dead code and orphan objects lightens the application and any future project.
  • Finally, what will go away: if a migration is decided, there is no point reworking what will be rewritten.
1
complete inventory, before any decision
4
kinds of object to run on a copy: forms, queries, reports, buttons
0
rows of your table data needed to measure the debt

Preventing debt in future

A few habits limit how much builds up: keep paths in a settings table, protect every value pasted into SQL (or use parameterised queries), keep a versioned reference copy, document each fix next to the code, and delete rather than comment out what is no longer used.

To measure the actual errors in your application rather than guess them, see taking over an inherited Access database.

All articles

What about your application?

The diagnostic runs on your computer, without sending the contents of your tables. The summary is free.