Opening Access from Word
I have a Word document which I wish to have close and open an Access Database
form.
This is the code I have put cmdAccess1 Click which shows under
Project(Viable) Microsoft Word Objects:
Private Sub cmdAccess1_Click()
On Error GoTo Err_cmdAccess1_Click
Dim oApp As Object
Set oApp = CreateObject("Access.Application")
oApp.Visible = True
oApp.Database.Open "c:\test\access\TEST.mdb"
Exit_cmdAccess1_Click:
Exit Sub
Err_cmdAccess1_Click:
MsgBox Err.Description
Resume Exit_cmdAccess1_Click
End Sub
If all went well and the Access database would open and at a Switchboard
form for the user to navigate through and close the Word program.
Best would be to have it reopen the form that it came from in the database
as there is a command button in Access which opens this report. Have no idea
how to do this but the code above is my start.
|