Description
You close a database and supposedly terminate Access. After that, databases can no longer be opened by clicking on the file in Windows Explorer or on a shortcut. The result is only a lock file (laccdb) visible in Explorer. If you open Access first, databases can be opened from there. The problem has arisen in the last few weeks or months, even with databases that have been working for years.
The reason for this behaviour is a hanging instance of the msaccess.exe, which you can see and terminate in the Task Manager. However, the problem recurs, either constantly or only from time to time.
All Access versions from 2016 to 365 in all current 240x and beta versions seem to be affected, both on Windows 10 and 11. There are several discussions about the problem, e.g.
page 9 onwards in this old TechCommunity thread
Cause
There have been reports of this type of problem in the past. The reasons were bugs or the installation of other programs such as Grammarly. However, recently the number of reports has increased dramatically. So we assume that there is a new variant with a much wider distribution.
In the above-mentioned TechCommunity thread the affected user "CampDirector" posted the following scenario:
Close all Access DBs.
Go to Windows Settings, Accessibility (left hand menu).
Click on Text Cursor and enable Text Cursor Indicator "ON"
Open Access DB, then close it.
Trying to open it again does not work, MSACESS.EXE still running, only way is to end task.
To get your computer "back to normal", simply disable Text Cursor Indicator, and Access opens and closes normally.
This scenario is reproducible for several people and also within the AFo team. For some with every database, for others only if they set the Text Cursor size to maximum and not with all databases.
On May 14, Colin Riddington found two more accessibility settings that trigger the hanging task "reliably": Screen Magnifier and Narrator
However, the problem occurs for many people without this accessibility settings enabled. Therefore, there must be also other or root causes.
Status
Microsoft has released a fix with version 2405 build 17628.20110 in the Current Channel on 29th May.
In our tests, the fix has resolved the hanging task in the cases where accessibility features are involved. As written, there must be other cases as well. So if you were affected by the bug, please let us know in a comment whether the new build fixes the problem for you or not.
Workarounds
The only known workarounds are the various ways to forcefully terminate the open or hanging Access task.
Several methods are mentioned in the comments to this article. Caution is advised here, as forcibly terminating tasks can be problematic in two ways: Some methods terminate all running Access tasks, i.e. potentially more than intended, and there is always a residual risk of damaging the affected Access files.
In his comment here, Keimpe Wiersma mentions the easy-to-use API function EndTask to reliably terminate the current Access task from within the application.
Another method to do this is the API function TerminateProcess. Philipp Stiefel explains it in this video and offers an example file: Windows API in VBA – Terminate Process – Workaround for Access Hanging on Close
Colin Riddington has a detailed article on all the workarounds.