Jezebel said:
Jezebel, I tried out your method first and I'm not sure if the coding
that
you provided was right?
{ IF { = MOD({PAGE}, 2) = 1 "X" " " } - has an extra open { so I
thought
that it should appear after the 2)}?
{ IF { = MOD({PAGE}, 2)} = 1 "[page break]" " " } as this then
completes
the If statement function correct?
However it inserts a double page break after each record and makes no
distinction between those that finish on odd or even pages. I tinkered
around
with the coding and orders etc. But my understanding of the MOD
function
is
limited so any assistance would be fantastic.
I did test this, so persevere if the other methods aren't working. To
test
this sort of field coding, do the bits separately and build --
1) { = MOD(x,y) } -- the result is the remainder of x divided by y.
Insert { PAGE } for x and 2 for y. Create a dummy document, insert this,
and
check what happens if the page number containing the field is odd or
even:
the result should be 1 or 0 respectively.
2) { IF { = MOD({ PAGE }, 2) } = 1 "ODD" "EVEN" } -- the result
should be ODD or EVEN according to whether you're on an odd or even page.
3) Replace "ODD" with "AAA[page break]BBB" --- if on an odd page
you
should see AAA then BBB on the following page.
4) Remove the extraneous stuff and you're done.
Well I've tried the coding again seperately and it all worked fine. The
problem is when I use that coding in my actual document. I've checked over
the code several times and its fine and works properly independently but
doesn't in the actual document I use.
What happens is that after the merge, it is quite a large document and so
to
build all the letters it becomes a few hundred pages long. The MOD
function
seems to get stuck on a certain number and I can't seem to update the
field
to represent the proper page number which is why I am always either
getting
an extra page inserted after each record or no page inserted at all
depending
on what page the MOD function gets stuck on. The PAGE function also gets
stuck and returns a value of say 3 or something but after updating the
form
letter it then represents the proper page number but the MOD function has
since returned the page break and doesn't update.
So if I had {IF{= MOD {PAGE}, 2} = "1" "odd" "even"} then it would always
return odd since it likes to get stuck on {PAGE} = "3" until I manually
update the form letter again. Is there a way of updating the coding too so
that it reads the {PAGE} properly and works?
I know that this function works as I too did the testing and build on a
seperate document but I just can't get it to work on this main document.
Thanks for the help, I would be a LOT more frustrated if not for it.