Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
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
Medium Priority
?
1,106 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 37

Accepted Solution

by:
Joanne M. Orzech earned 375 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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

I would like to show you some basics you can do with Mailings in MS Word. It´s quite handy feature you can use for creating envelopes, labels, personalized letters etc. First question could be what is this feature good for? Mailing can really he…
This is written from a 'VBA for MS Word' perspective, but I am sure it applies to most other MS Office components where VBA is used.  One thing that really bugs me is slow code, ESPECIALLY when it's mine!  In programming there are so many ways to…
This video walks the viewer through the process of creating an MLA formatted document, as well as a bibliography with citations.
This video walks the viewer through the process of creating Hyperlinks for the web and other documents. Select the "Insert" tab: Click "Hyperlink":  Type "http://" followed by a web address to reference a website or navigate to a document to ref…
Suggested Courses

722 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