Access 2013 open another database

rgwfly

Registered User.
Local time
Today, 02:42
Joined
Jun 7, 2016
Messages
49
I've searched and read the older forums. Most what I found pertain to older versions of Access.

I am trying to open one access file from another using VBA
I currently have the following code:
Function OpenWindingDB()
Dim appAcc As Access.Application
Set appAcc = New Access.Application
appAcc.Visible = True
appAcc.OpenCurrentDatabase ("\\MyNetworkFile\name.accdb")
appAcc.UserControl = True
appAcc.RunCommand acCmdAppMaximize
appAcc = Nothing
End Function

This opens a new access window but will not open the file.
I get a runtime error of database missing or it is not an ADP file.

Thanks for any help you can provide.
 
Hi,

If you just want to open it, then use FollowHyperlink method, so
Code:
Application.FollowHyperlink("\\MyNetworkFile\name.accdb")

If this does not work due to the file path, try the drive letter EG C:\MyNetworkFile\name.accdb
 
I use the following with Access 2010 and it works fine?
Code:
    Set appAcc = New Access.Application
    
    appAcc.Visible = True
    appAcc.OpenCurrentDatabase (strSourcePath & strSourceFile)
    appAcc.UserControl = True
    appAcc.RunCommand acCmdAppMaximize

Is your filename / path actually correct?
 

Users who are viewing this thread

Back
Top Bottom