View Single Post
  #3   Report Post  
Peter Jamieson
 
Posts: n/a
Default

Assuming your "True" comparisons are working (which they should if you are
using the default connection method in Word XP/2003) then the only time you
need to /miss/ a comma is at the very beginning, so try, e.g.

{ SET comma ""
}{ IF { MERGEFIELD "Bolsover" } = "True" "Bolsover{ SET comma ", " }" "" }
}{ IF { MERGEFIELD "Chesterfield" } = "True" "{ REF comma }Chesterfield{ SET
comma ", " }" "" }
}{ IF { MERGEFIELD "Derbyshire Dales" } = "True" "{ REF comma }Derbyshire
Dales{ SET comma ", " }" "" }
}{ IF { MERGEFIELD "High Peak" } = "True" "{ REF comma }High Peak{ SET comma
", " }" "" }
}

where all the {} are the special field braces you can insert using ctrl-F9

Peter Jamieson
"Viperpurple" wrote in message
...
I am trying to create a mail merge using an access data source. The
problem
i have is printing a comma seperated list using information stored as
seperate fields with a yes/no answer in the database.

e.g.

Fields:

Bolsover
Chesterfield
Derbyshire Dales
High Peak

List Format:

Bolsover, Chesterfield
OR
Chesterfield, Derbyshire Dales, High Peak

So the main point is that i need to list 'Chesterfield' if the
Chesterfield
field is 'True', i have done this but am having real problems adding the
', '
if the value has something preceding it and then missing it out if there
isn't.

Currently using:

{IF {MERGEFIELD "Bolsover"} = "True" "Bolsover" ""}

Tried Using:

{IF {MERGEFIELD "Bolsover"} = "True" "{IF {MERGEFIELD "Chesterfield"} =
"True" ", Chesterfield" "Chesterfield"}" ""}

Sorry for the long post but it was difficult to explain, thanks for
reading
and just let me know if you need more info. I really hope you can help, i
think its quite a challenge.

Regards

Adam