Setting Command Button in Word Document

S

Slow Learner

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.
 
W

Word Heretic

G'day Slow Learner <[email protected]>,

ODBC

Steve Hudson - Word Heretic

steve from wordheretic.com (Email replies require payment)
Without prejudice


Slow Learner reckoned:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top