Connecting Tech Pros Worldwide Help | Site Map

Insert 'subform' in Word mail-merge?

 
LinkBack Thread Tools Search this Thread
  #1  
Old March 20th, 2007, 10:39 AM
Newbie
 
Join Date: Mar 2007
Posts: 13
Default Insert 'subform' in Word mail-merge?

I run a recruitment service for which, years ago, I set up an Access database to record details of job applications and run various mail merge functions including interview invitations, reference requests and panel letters.

However, my letters contain only the details that can be recorded in single fields. e.g. title, first name, last name, address1, address2, etc. Currently, where lists are involved, e.g. names of the interview panel, lists of applicants and interview times, we just have to type them in for each batch of letters.

These details are displayed on the database as a subform. My question is, is there any way to insert a subform straight into a Word document as part of the mail-merge - or does one have to pre-define the number of possible list items, e.g. applicant 1, applicant 2, or panel member1, panel member2, etc?

Any help would be appreciated.

Brigid
Reply
  #2  
Old March 22nd, 2007, 01:05 AM
msquared's Avatar
Administrator
 
Join Date: Aug 2006
Location: Dublin, Ireland
Posts: 10,718
Default

Hi Brigid

This is not my area of expertise but I would guess that the only way of doing this would be with complicated Word Automation VBA code using recordsets.

Mary
Reply
  #3  
Old March 22nd, 2007, 11:22 AM
Newbie
 
Join Date: Mar 2007
Posts: 13
Default

Hi Mary,

Thanks. I subsequently wondered whether I might get round the problem by creating a field that contains an array, e.g. AppID, AppName, IntTime, new line. I am sure I did something like this for a programming exercise (in Pascal!!) years ago, but I am not familiar enough with VBA to know if it is possible.

Does this sound feasible?

B
Reply
  #4  
Old March 22nd, 2007, 09:37 PM
Denburt's Avatar
Moderator
 
Join Date: Mar 2007
Location: Louisiana
Age: 43
Posts: 1,197
Default

I started to give this one a go earlier however like Mary stated this is not an area I have dealt with very much. I think you hit the nail on the head or at least real close. My first thought was to create a query based on the main table and the child table however this would probably send out many emails to each person. However if you created the query and converted it to a crosstab query it just might work. Word does recognize queries when you want to do a mailmerge.
Reply
  #5  
Old March 22nd, 2007, 09:45 PM
Denburt's Avatar
Moderator
 
Join Date: Mar 2007
Location: Louisiana
Age: 43
Posts: 1,197
Default

As an alternative you could send out the info straight from access. Create a report with the info you want. If you add something like the following to a button click event you could be good to go.

DoCmd.SendObject acSendTable, "Employees", acFormatXLS, _
"Nancy Davolio; Andrew Fuller", "Joan Weber", , _
"Current Spreadsheet of Employees", , False

Let me know if you need more details or if this does or doesn't help you out.
BTW if you paste this in the VBA window then highlight the word sendobject press F1 and get the full syntax for this method.
Reply
  #6  
Old March 23rd, 2007, 03:05 AM
msquared's Avatar
Administrator
 
Join Date: Aug 2006
Location: Dublin, Ireland
Posts: 10,718
Default

Regarding Deburt's idea of a Crosstab query ...

Something like ...
Expand|Select|Wrap|Line Numbers
  1. TRANSFORM ApplicantName
  2. SELECT JobRef
  3. FROM TableName
  4. GROUP BY JobRef
  5. PIVOT ApplicantName;
Reply
  #7  
Old March 23rd, 2007, 10:51 AM
Newbie
 
Join Date: Mar 2007
Posts: 13
Default

No reason why I need to print letters in Word at all really. Seems the simplest solution will be to recreate the letter as a report in Access.

Thanks to all.

B
Reply
  #8  
Old March 23rd, 2007, 02:02 PM
Denburt's Avatar
Moderator
 
Join Date: Mar 2007
Location: Louisiana
Age: 43
Posts: 1,197
Default

Your quite welcome, also there are other methods in MS Access that are even more robust. Let us know if we can be of any more assistance.
Reply
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search


Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,662 network members.