I'm trying to close another database if it's opened.
it seems there's a method for this purpose, but Microsoft doesn't offer any example of the usage.
This is what I have so far:
I receive a compile error on DoCmd : Wrong Number of Arguments or invalid property assignment
My questions:
1- While in DatabaseA , How can I close DatabaseB? What is the best method to check if a database is opened and close it?
2- What's the correct usage of above method?
I appreciate any kind of help.
it seems there's a method for this purpose, but Microsoft doesn't offer any example of the usage.
This is what I have so far:
Code:
Dim Pth As String
Pth = CurrentProject.path & "\AnotherDatabase.laccdb"
If fFileExists(Pth) Then
....Do some Actions here
'Close it
DoCmd.CloseDatabase CurrentProject.path & "\AnotherDatabase.accdb"
Exit Function
Else
Application.Quit
End If
I receive a compile error on DoCmd : Wrong Number of Arguments or invalid property assignment
My questions:
1- While in DatabaseA , How can I close DatabaseB? What is the best method to check if a database is opened and close it?
2- What's the correct usage of above method?
I appreciate any kind of help.
Last edited: