Solved

How to use NextIf with a database field as parameter in mail merge based on SQL server view

Posted on 2004-09-24
3
1,085 Views
Last Modified: 2008-01-09
Hi, guys.

I have been looking for a solution to this for a day now and I am getting a bit frustrated! I saw a similar request regarding a library system earlier, but without a real answer.

What I am trying to do should in my opinion be fairly easy, but somehow I cannot get the NextIf function of the mail merge in Word 2003 to work how I want it to:

I have a table (it is really a view on my SQL server) that has information regarding the orders placed by certain customers. For each item ordered by a customer, the table contains one line of information.

Thus, for a given customer there could be one or several records in the table.

What I want to do is to print a order confirmation for each customer, including the contact information and basic order information only once (of course), but be able to include all the order details (item number, item name and price) in this letter.

What I have tried to do is to use the NextIf function, but somehow it seems this will not accept a mailmerge field (aka a database field) as a parameter to compare with.

Could someone please enlighten me on how to achieve this? Is it at all possible? And if it isn't, what the %&) are the guys at Microsoft thinking..... There must be a million uses for this particular functionality!

Regards, and I hope someone points at me real fast and say 'Here's how, stupid!'
Andreas



0
Comment
Question by:obiwankenobi
  • 2
3 Comments
 
LVL 37

Accepted Solution

by:
Joanne M. Orzech earned 125 total points
ID: 12144793
Believe it or not - it's not easy.... it's almost impossible to do this!  Having said that, here's a post with a macro that might help:
http://www.experts-exchange.com/Applications/MS_Office/Word/Q_20863318.html

I know some people who know some people who know how to do this... I just have to find the right link :)

Will post back.
0
 
LVL 5

Expert Comment

by:Miles_stylus
ID: 12198263
if it is proving this hard within word why not use a report with a sub report?  Thus the main report would contain all the single instance information (contact, overal price etc) with a sub report showing all the detail information?

Then rather than running the report in word your would print it straight from your datebase?

HTH

Miles
0
 
LVL 37

Expert Comment

by:Joanne M. Orzech
ID: 12375615
Thanks obiwan!
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Like many others, we try and discourage users from printing documents unnecessarily and instead send or share them electronically. However, this doesn't always work and documents are still printed. With this simple solution, if the user tries to …
This article describes how to use the Send to Mail Recipient command. The instructions apply generally to Office 2007 and later versions, but Microsoft® Word 2013 was used for the specific steps and figures.  What is Send to Mail Recipient? Send…
This video teaches the viewer how to align pictures around text while keeping the text properly aligned in the document.
This Micro Tutorial well show you how to find and replace special characters in Microsoft Word. This is similar to carriage returns to convert columns of values from Microsoft Excel into comma separated lists.

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question