The strDatabaseName has to be declared globally. It is used by a function in the .bas file to get the path to the database.

I use this same code all the time and it works fine until today.

The error occurs when the variables are declared.