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,081 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Introduction This tutorial provides instructions on how to properly format your Word document using the inbuilt tools provided. The benefits of using these tools means your documents are more accessible and easily portable to other applications an…
Shortcuts in Word Just the other day I had a training for Microsoft and they wanted me to show how well the new Windows and Office behaved on a touch device, which by the way is great, but it was only then that I realized that using keyboard shortc…
This video walks the viewer through the process of creating an MLA formatted document, as well as a bibliography with citations.
This video shows where to find templates, what they are used for, and how to create and save a custom template using Microsoft Word.

815 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now