Question : Keep ACCESS db available after Excel opens it

My code opens the database but then it closes it when the sub finishes.  How can I keep it open as I need Excel to execute a procedure after it opens.  I want the workbook to stay open.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
Public Sub OpenAccess()
'Open ACCESS, start procedure and close this workbook
Dim strPath As String, objAccess As New Access.Application
strPath = "N:\US\US Client Relationship & Business Development\Client Reporting\Private\New Client Reporting\Client Service\Sandra\PROJECTS\JerrysProject\"

Set objAccess = CreateObject("Access.Application")

objAccess.Visible = True

objAccess.OpenCurrentDatabase strPath & "PortChar.mdb"

End Sub

Answer : Keep ACCESS db available after Excel opens it



objAccess.OpenCurrentDatabase strPath & "PortChar.mdb"
objAccess.UserControl =  True '  ** add this and see if this helps ?
Random Solutions  
 
programming4us programming4us