L
LDMueller
Hello,
I have Word 2003 and Access 2003. I'm trying to write VBA code to open a
database from within Word.
Can anyone explain why this code works (see below) ...
Sub OpenDatabase()
' Opens the Northwind database
Dim MyAccess As Object
Set MyAccess = GetObject("C:\Program Files\Microsoft
Office\OFFICE11\SAMPLES\Northwind.mdb", "Access.Application")
End Sub
And this code does not work (see below) ...
Sub OpenDatabase()
' Opens the MyDatabase database
Dim MyAccess As Object
Set MyAccess = GetObject("C:\Program Files\Microsoft
Office\OFFICE11\SAMPLES\MyDatabase.mdb", "Access.Application")
End Sub
My database named MyDatabase.mdb resides in the same path as the
Northwind.mdb database so I can't figure out why this code won't work. Any
assistance would be greatly appreciated.
I have Word 2003 and Access 2003. I'm trying to write VBA code to open a
database from within Word.
Can anyone explain why this code works (see below) ...
Sub OpenDatabase()
' Opens the Northwind database
Dim MyAccess As Object
Set MyAccess = GetObject("C:\Program Files\Microsoft
Office\OFFICE11\SAMPLES\Northwind.mdb", "Access.Application")
End Sub
And this code does not work (see below) ...
Sub OpenDatabase()
' Opens the MyDatabase database
Dim MyAccess As Object
Set MyAccess = GetObject("C:\Program Files\Microsoft
Office\OFFICE11\SAMPLES\MyDatabase.mdb", "Access.Application")
End Sub
My database named MyDatabase.mdb resides in the same path as the
Northwind.mdb database so I can't figure out why this code won't work. Any
assistance would be greatly appreciated.