I am trying to open access from VB, as i need to run some queries/macros to manipulate the data before i use it within VB. I am using the following code to test open the database.
Private Sub Form_Load()
Dim LetterType As String
Dim AccessApp As Access.Application
Dim DBPath As String
DBPath = "C:\My Documents\darryl.mdb"
Set AccessApp = New Access.Application
With AccessApp
.openCurrentDatabase DBPath
.DoCmd.OpenTable "R01"
End With
AccessApp.quit
However it doesn't seem to like the
Dim AccessApp as Access.Application
line. I comes back with a user type not defined error.
Private Sub Form_Load()
Dim LetterType As String
Dim AccessApp As Access.Application
Dim DBPath As String
DBPath = "C:\My Documents\darryl.mdb"
Set AccessApp = New Access.Application
With AccessApp
.openCurrentDatabase DBPath
.DoCmd.OpenTable "R01"
End With
AccessApp.quit
However it doesn't seem to like the
Dim AccessApp as Access.Application
line. I comes back with a user type not defined error.