The Problem (Q-score 19, ranked #3rd of 67 in the Access VBA archive)
The scenario as originally posted in 2009
I want to do something like this within an MS Access query, but SUBSTRING is an undefined function.
SELECT DISTINCT SUBSTRING(LastName, 1, 1)
FROM Authors;
Why community consensus is tight on this one
Across 67 Access VBA entries in the archive, the accepted answer here holds elite answer (top 10 %%) status — meaning voters are unusually aligned on the right fix.
The Verified Solution — elite answer (top 10 %%) (+26)
6-line Access VBA pattern (copy-ready)
You can use the VBA string functions (as @onedaywhen points out in the comments, they are not really the VBA functions, but their equivalents from the MS Jet libraries. As far as function signatures go, they are called and work the same, even though the actual presence of MS Access is not required for them to be available.):
SELECT DISTINCT Left(LastName, 1)
FROM Authors;
SELECT DISTINCT Mid(LastName, 1, 1)
FROM Authors;
When to Use It — vintage (14+ years old, pre-2013)
A top-10 Access VBA pattern — why it still holds up
Ranks #3rd of 67 in the Access VBA archive. The only pattern ranked immediately above it is “What do I need to read Microsoft Access databases using Python?” — compare both if you’re choosing between approaches.
What changed between 2009 and 2026
The answer is 17 years old. The Access VBA object model has been stable across Office 2013, 2016, 2019, 2021, 365, and 2024/2026 LTSC, so the pattern still compiles. Changes that might affect you: 64-bit API declarations (use PtrSafe), blocked macros in downloaded files (Mark-of-the-Web), and the shift toward Office Scripts for web-first workflows.