Hello,
I am trying to access a access database through a third party application. The functionality that I seek to modify is that when the user click on a button in the third party application, It would open the access file, delete a query , create a query and run it.
I am running in to Error 2046 which based on my research says that it occurs because the access application is not active when the code is called.
The code that I have currently is :
[VBA]If Not FileLocked(strDBName) Then ' This condition is added to prevent from multiple copies of access to be opened.
objAccess.OpenCurrentDatabase strDBName, True
End If
objAccess.DoCmd.DeleteObject 1, "qryInfoLetter" ' This is where the error triggers
[/VBA]
This code runs fine when the access file is closed. But causes problems when the access file is open.
Please help!
Thank you
Vinod