Hi,
I have a function from a command button, that opens another database from within my current db, runs a module there, and then closes it. The function itself works fine. Here's the problem: if the active user already has an instance of the reference db open, the function throws an error, and fails. Here is the code:
What I'm hoping to find some help with, is a way to test if the active user has a instance of the reference db ("Cash_mgmt.mbd") already open. Even better if someone can help me find a way to close the instance before executing my code.
Thanks!
Melanie
I have a function from a command button, that opens another database from within my current db, runs a module there, and then closes it. The function itself works fine. Here's the problem: if the active user already has an instance of the reference db open, the function throws an error, and fails. Here is the code:
Code:
Dim appAccess As New Access.Application
Dim strDBLoc As String
strDBLoc = fncFindCashMgmt
strDBLoc = strDBLoc & "Cash_mgmt.mdb"
SendKeys "%O", False
appAccess.OpenCurrentDatabase strDBLoc
SendKeys "{ENTER}", False
appAccess.Run "Cash_mgmt.importActivityfromLMS"
appAccess.CloseCurrentDatabase
MsgBox "Import Pool Activity completed."
What I'm hoping to find some help with, is a way to test if the active user has a instance of the reference db ("Cash_mgmt.mbd") already open. Even better if someone can help me find a way to close the instance before executing my code.
Thanks!
Melanie