1 Reply Latest reply on Jan 11, 2013 9:16 AM by philmodjunk

    Mail Merging.....



      Mail Merging.....



           I am creating letters in my database which mail merge fields into it.  Easy enough.  My question is, I'm debating what is the best way to have users enter contat details for clients.  As they can have more than one contact number and type I was considering making a contact details table and having a field for the details (Telephone number) and then the type of contact (home, mobile, work, etc).  But if I use this method, how do I mail merge the info into letters, say if I want to mail merge the clients home phone? 


           Can this be done this way or is there a better way to enter this information?

        • 1. Re: Mail Merging.....

               First, make sure to use a value list for selecting contact type to avoid inconsistencies in how the type is entered. (You don't want one user to enter "business" and another to enter "work" for the same contact type in two different records.)

               Then, do you want to limit the layout to always just one contact type or do you want to enable the user to select the contact number that they want to use?

               The same basic method works either way, but the details a just a bit different.

               Presumably you already have a relationship similar to:

               Contacts::__pkContactID = ContactDetails::_fkContactID

               And presumably, your form letters layout refers to Contacts.

               To this, we can add a new relationship to a new occurrence of ContactDetails:


               Contacts::_fkContactID = ContactDetails|Selected::_fkContactID AND
               Contacts::SelectType = ContactDetails|Selected::ContactType

               If this notation is not familiar, see the first post of: Common Forum Relationship and Field Notations Explained

               To create a new occurrence of ContactDetails, select it in Manage | Database | Relationships and click the duplicate button (two green plus signs). This does not create a new table, just a new reference to the existing ContactDetails table. You can double click the new occurrence to get a dialog box where you can rename it like I show here.

               Your merge field would then be: ContactDetails|Selected::ContactNumber instead of ContactDetails::ContactNumber.

               The data in SelectType will control which contact number appears in this field. If you want to limit the letter to always one specific type, you can set up SelectType as a calculation field with a text string as the sole calculation term. "Work" for example, then "hard wires" your relationship to only contact details of type "Work".

               If you make SelectType a text field instead of a calculation field, you can format it with the same value list as ContactType and now the user can select a contact type for their form letter. If you keep it as just a simple text field, they will have to select a contact type for each record in contacts--allowing them to specify different contact numbers for different contacts. If you give SelectType global storage, you limit the letters to the same contact type for all contacts, but now you can make a single selection instead of once on each contact record for which you wish to print the letter.