I made a module that imports all the tables, data and relationships from one db into a blank mdb file so users can make ad hoc queries and reports. But this error comes up when I try to make a new report, form, etc into db that imported all the tables.
You do no have exclusive access to the database at this time. If you proceed to make chages, you may not be able to save them later.
This despite the fact that I'm the only using the db. Any suggestions?
Update: right now in the form that imports the tables, there's an import button and delete button. If import the tables then close it and then reopen it, I don't get the above error. But the thing is I want the tables imported and deleted when the db is opened and closed, respectively.
Another update:
I run this code:
Dim obj As AccessObject, dbs As Object
Set dbs = Application.CurrentData
' Search for open AccessObject objects in AllTables collection.
For Each obj In dbs.AllTables
If obj.IsLoaded = False Then
' Print name of obj.
Debug.Print obj.Name
End If
Next obj
and it prints all the table names. So it looks the tables aren't "loaded" despite the fact they are imported. Any suggestions?
scratch
You do no have exclusive access to the database at this time. If you proceed to make chages, you may not be able to save them later.
This despite the fact that I'm the only using the db. Any suggestions?
Update: right now in the form that imports the tables, there's an import button and delete button. If import the tables then close it and then reopen it, I don't get the above error. But the thing is I want the tables imported and deleted when the db is opened and closed, respectively.
Another update:
I run this code:
Dim obj As AccessObject, dbs As Object
Set dbs = Application.CurrentData
' Search for open AccessObject objects in AllTables collection.
For Each obj In dbs.AllTables
If obj.IsLoaded = False Then
' Print name of obj.
Debug.Print obj.Name
End If
Next obj
and it prints all the table names. So it looks the tables aren't "loaded" despite the fact they are imported. Any suggestions?
scratch
Last edited: