Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Merging an Access table into MS Word's mail merge.

Status
Not open for further replies.

kjspear

Programmer
Feb 13, 2002
173
US
Hello once again:

I'm still having an issue merging my Access table into MS Word's mail merge. Okay, what I'm trying to do in Word is have the user select the Name of event, Date of event, etc. I would like to have this using a dropdown box using Word instead of the Mail Merge wizard. Once the user selects this criteria, then the merge will be executed. Of course the dropdown boxes will have to see the Name and Date of events so that Word will already know what they are so the user can select it. I will not be able to type these names and dates into code because they change often. Below is my attempt to do this;

Sub pccmembers()
'
' pccmembers Macro
' Macro recorded 6/16/2005 by MEG17-18
'
ActiveDocument.MailMerge.MainDocumentType = wdFormLetters
ActiveDocument.MailMerge.OpenDataSource Name:= _
"F:\bsn\Test of AccessCustomerDatabaseXA.mdb", ConfirmConversions:=False, _
ReadOnly:=False, LinkToSource:=True, AddToRecentFiles:=False, _
PasswordDocument:="", PasswordTemplate:="", WritePasswordDocument:="", _
WritePasswordTemplate:="", Revert:=False, Format:=wdOpenFormatAuto, _
Connection:= _
"Provider=Microsoft.Jet.OLEDB.4.0;Password="""";User ID=Admin;Data Source=F:\bsn\Test of AccessCustomerDatabaseXA.mdb;Mode=Read;Extended Properties="""";Jet OLEDB:System database="""";Jet OLEDB:Registry Path="""";Jet OLEDB:Database Password="""";Jet OLEDB:Engine Typ" _
, SQLStatement:="SELECT * FROM `registration` where PCCMEMBER='Y'", SQLStatement1:="", _
SubType:=wdMergeSubTypeAccess
ActiveDocument.MailMerge.ViewMailMergeFieldCodes = wdToggle
End Sub

Please let me know if you need more information.

Thanks,
KJ
 
KJ, have you had any luck sorting this just i am trying to do the same thing with no sucess so any advice would be great !! :)

 
Hello ch4meleon;

Are you trying to open MS Word using MS Access? When you say sorting, what are you trying to sort?

KJ
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top