Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Mailmerge and Fax / November 2004

Tip: Looking for answers? Try searching our database.

Conditional mail merge checkboxes

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
franko - 09 Nov 2004 19:00 GMT
I'm creating a mail merge document that will attach to a MS Access database.  
One of the merge fields is called "ClassType" and is a numberic value (1-6).  
How do I create check boxes on the word document and have the appropriate
checkbox checked depending on the ClassType field value when I do the mail
merge?  

I'm new to creating conditional mail merges, so any help would be
appreciated.  I've placed six form checkboxes on the document but cant get
them to work with the mail merge.
tcptang - 09 Nov 2004 22:39 GMT
The codes below work in my document.  Hope it helps.

  With ActiveDocument.MailMerge.DataSource
   
     ' assumed that the merge field "ClassType"
     ' is the second field in the datasource.
     ' If it is the 3rd, then change the select statment to
     ' Select Case .DataFields(3).Value
     
     ' init
     CheckBox1.Value = False
     CheckBox2.Value = False
     CheckBox3.Value = False
     
     Select Case .DataFields(2).Value
        Case 1
           CheckBox1.Value = True
        Case 2
           CheckBox2.Value = True
        Case 3
           CheckBox3.Value = True
        Case Else
           ' do nothing
     End Select
  End With

> I'm creating a mail merge document that will attach to a MS Access database.  
> One of the merge fields is called "ClassType" and is a numberic value (1-6).  
[quoted text clipped - 5 lines]
> appreciated.  I've placed six form checkboxes on the document but cant get
> them to work with the mail merge.

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.