Welcome to W3Courses
 Like Us on Facebook

MS Access

VBA Code to Call Windows API File Open Dialog Box in Microsoft Access

The code below calls the windows API File Open dialog box and when a user selects a file the function returns the file path.

Option Compare Database
Option Explicit


How to Solve Could not Lock File Error in Microsoft Access?

This error occurs when the .ldb file is not automatically deleted when the user closes MS Access. In theory, the .ldb file should automatically get created when user connects to the database and automatically get deleted when user stops using the database.

The way to fix this problem is to delete the .ldb file. The .ldb file will be in the same folder as the database itself. If the “File in Use” error is received when trying to delete the .ldb file, use the following steps to delete the file