#1
|
|||
|
|||
Mail merge from Access to Word
I am preparing a Word document for a mail shot, and need to import data from my access file. I am trying to build a formula that will take a field from the Access file and, if it is true, print some data.
So far, I have =IF(Schedule 2014=40,full page). Schedule 2014 is a column in the query I am using in this mail merge, 40 is an amount of money in that column and full page is the text that should appear in the Word document. The result I am getting is!Syntax Error, 2014 . The remainder of the information I am merging is working well. I am asking for the 40 to appear in the relevant recipient's letter which is fine, but I want it to print full page before it (or half page for 30, or quarter page for 20) Anyone help? |
#2
|
||||
|
||||
If there are only the three relevant values, then in the merge document itself include the following field construction:
{ IF { MERGEFIELD "Schedule 2014" } ="40" "{ INCLUDETEXT "C:\\Path\\Fullpage.docx" }" }{ IF { MERGEFIELD "Schedule 2014" } ="30" "{ INCLUDETEXT "C:\\Path\\Halfpage.docx" }" }{ IF { MERGEFIELD "Schedule 2014" } ="20" "{ INCLUDETEXT "C:\\Path\\Quarterpage.docx" }" } Each bracket pair is inserted with CTRL+F9. Change the names and paths of the three documents, as appropriate, to insert the text they contain.
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Mail merge pictures from Access to Word | Jolsen | Mail Merge | 7 | 11-22-2013 01:23 PM |
Mail Merge from Access Query to Word | ChrisMan | Mail Merge | 2 | 12-10-2012 11:22 PM |
Access to Word Mail Merge Issue (255 characters) | ChrisPine | Mail Merge | 1 | 02-16-2012 10:01 PM |
Access password blocking Word mail merge | dbaldwin | Mail Merge | 3 | 04-22-2011 02:50 PM |
Word / Access - Mail Merge | ibuilders | Mail Merge | 0 | 07-30-2007 06:18 PM |