I know how to do the office link thingy, but if I wanted to run a mail merge document using a query and a switchboard button? It is my next source of frustration.. Please help..........
If you're actually using the switchboard, you're out of luck. The closest you can get to this is to have the switchboard open up a form that can THEN take you to the mailmerge document.
By far the easiest way to open up the mailmerge document is to use in VBA code:
[tt]Shell "N:\full\path\filename.DOC"[/tt]
And that opens your mailmerge document.
Alternately, I have written a FAQ about using mailmerge from Access, but you'd have to be very comfortable with VBA code to use it:
'Native' mailmerge reports - as painless as possible faq181-5088
So I use this code in my whitchboard?
rivate Sub Option3_Click()
'Function MergeIt()
Dim objWord As Word.Document
Set objWord = GetObject("D:\archive\DUMMY_1040MFS.doc", "Word.Document")
' Make Word visible.
objWord.Application.Visible = True
' Set the mail merge data source as CorrBatch4Pasted.
objWord.MailMerge.OpenDataSource _
Name:="D:\archive " & _
"National Archive.mdb", _
LinkToSource:=True, _
Connection:="TABLE CorrBatch4Pasted", _
SQLStatement:="SELECT * FROM [Forms]![Batch 4 stat query]![Combo2]"
' Execute the mail merge.
objWord.MailMerge.Execute
'End Function
End Sub
This is the code I have been trying to use. But when I have my switchboard open at startup my references are lost.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.