I am trying to run this code, I got from another thread on this forum that is closed. It is supposed to link to an Access file and run it's macro.I have 2007, so my db files are ".accdb" if that changes anything. Here is the code:
VB:
I am getting the errorCode:Dim strDatabasePath As String Dim appAccess As Access.Application strDatabasePath = "C:\Users\zachk\Desktop\Strats 2011.01.accdb" Set appAccess = New Access.Application With appAccess Application.DisplayAlerts = False .OpenCurrentDatabase strDatabasePath .DoCmd.RunMacro "qry_MakeTrustTable_Adhoc" .Quit End With Set appAccess = Nothing
User-defined Type not defined
on line:
Set appAccess = New Access.Application




Reply With Quote
Bookmarks