i have this code:
Dim db As Database
ChDir Application.DefaultFilePath
a = Dir("MAG.MDB")
If a = "" Then
MsgBox "MAG.MDB not found"
Exit Sub
End If
Set db = Workspaces(0).OpenDatabase(a)
MsgBox "MAG.MDB is now open"
' use database here
db.Close
which i am using to open a database from excel, however u get a 'user type not defined error' wonder if anyone could enlighten me as to how i could correct this?
Dim db As Database
ChDir Application.DefaultFilePath
a = Dir("MAG.MDB")
If a = "" Then
MsgBox "MAG.MDB not found"
Exit Sub
End If
Set db = Workspaces(0).OpenDatabase(a)
MsgBox "MAG.MDB is now open"
' use database here
db.Close
which i am using to open a database from excel, however u get a 'user type not defined error' wonder if anyone could enlighten me as to how i could correct this?