Help to setup mailmerge sort by category in word 2000

H

Hell-fire

Hi,

Thanks to the link provided by Peter Jamieson, I saw a different way to sort
my mail merge. Now the problem is, I really can't figure out the logic on
how to do this.

I have created a mail merge in a catelog format that pulls data from an
Access Query. There are 13 fields involved. Two fields are practically the
same (Reportorder and Problemstatus), just one is a number the other is the
description. The Query is setup to sort by Reportorder (ascending) and ID
(descending)

When I do the mail merge it sorts everything the way I want, but I don't
want to see the Problemstatus repeated for the same category. I would like
the Problemstatus to show once followed by the ID's in that category, then
move on to the next category, etc.

For the Reportorder and Problemstatus, there are 12 categories. How would
one setup the mail merge field coding to do this? I hope I supplied enough
detail, but if not, please let me know what else you would like. Thank you
for anyone willing to tackle this problem of mine.
 
P

Peter Jamieson

Another example would help!

If there is a 1-1 correspondence between Reportorder and Problemstatus and
by "12 categories" you mean there are 12 Reportorder values (and 12
equivalent Problemstatus values), then you need to test either Reportorser
or Problemstatus in the same way that the example tests/ City.

e.g.

{ IF { MERGESEQ } = "1" "{ MERGEFIELD Reportorder }" "" }<ENTER>
{ SET RO1 { MERGEFIELD City }}<ENTER>
{ If { RO2 } <> { RO1 }"<ENTER>
{ MERGEFIELD ReportOrder } { MERGEFIELD Problemstatus }<ENTER>
<ENTER>
{ MERGEFIELD ID }" }{ SET RO2 { MERGEFIELD City }}<ENTER>

However, you may need to alter the <ENTER>s to achieve the layout you need.

If there isn't a 1-1 correspondence between Reportorder and Problemstatus
and there can be several combinations of them, then you need to tell us a
bit more about your inputs and desired outputs. (Sorry, I will be away for a
few days...)
 
H

Hell-fire

Hi Peter,

The Reportorder has value 1 to 12 and the Problemstatus description follows
the same order. For example 1 = Assessment in process-E, 2 = Assessment in
process-E/P.

For each record, the data corresponds correctly. On the mail merge template
though, I don't use Reportorder, but use Problemstatus and it sorts out
correctly, just don't need it to appear with each record. I hope I didn't
make this any more confusing.

I have tried to understand the format shown on the MS site, but not quite
sure how to properly formulate it. Thank you.
 
P

Peter Jamieson

Well, I totally failed to give yout the correct info - try, e.g.

{ IF { MERGESEQ } = "1" "{ MERGEFIELD Problemstatus }" "" }<ENTER>
{ SET PS1 { MERGEFIELD Problemstatus }}<ENTER>
{ If { PS2 } <> { PS1 }"<ENTER>
{ MERGEFIELD Problemstatus }<ENTER>
<ENTER>
{ MERGEFIELD ID }" "{ MERGEIELD ID }" }{ SET PS2 { MERGEFIELD
Problemstatus }}<ENTER>


Two possible problems are:
a. All the {} have to be the special field braces you can insert using
ctrl-F9
b. where the text says <ENTER>, press the Enter key (i.e. insert a
paragraph mark).

However, I would in any case do things a bit differently from the way they
have done it, e.g.

{ IF { MERGESEQ } = "1" "{ SET PS { MERGEFIELD Problemstatus } }" ""
}{ If { PS } <> { MERGEFIELD Problemstatus }
"{ MERGEFIELD Problemstatus }

" "" }{ MERGEFIELD ID }
{ SET PS { MERGEFIELD Problemstatus } }
 
H

Hell-fire

Hi Peter,

Well, I used your suggestion and it works, except that the first category
doesn't show up, but the rest do. For me I can actually live with the
result, but will have to see if the person I'm doing this for is okay with
the first category not showing.

Thank you so much for your help.
 
P

Peter Jamieson

Should be

{ IF { MERGESEQ } = "1" "{ SET PS "" }" ""
}{ If { PS } <> { MERGEFIELD Problemstatus }
"{ MERGEFIELD Problemstatus }

" "" }{ MERGEFIELD ID }
{ SET PS { MERGEFIELD Problemstatus } }

and it assumes that Problemstatus is never ""
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top