Code: Select all
Public Function dbOpenMDBDatabase(strFileName As String) As Database
Dim strPath As String
strPath = strFileName
Set dbOpenMDBDatabase = OpenDatabase(strPath, True, False)
End Function
I am happy.
However, if the Access database is already open (by me checking to see if a record already exists), the VBA open fails because someone else (me) has the database open.
I cannot find "OpenDatabase" in the Word VBA help, not surprising. In Access VBA I can find the keyword, but no help screen comes up.
I have a feeling that one of the "Options" in the OpenDatabase method might allow multiple access, but cannot find out how.
For what it's worth right now I'd be happy if me-as-end-user had read-only access to the database as long as the VBA code can add records on command.