Reply
 
Thread Tools Display Modes
  #1   Report Post  
Risseecm
 
Posts: n/a
Default Can I insert a conditional page break using field codes?

I need to insert a page break if a condition is true. For example, if the
Name field for the next record is different, print on a new page, otherwise
continue on the same page.
  #2   Report Post  
Graham Mayor
 
Posts: n/a
Default

{IF {Mergefield fieldname} = "True" "insert a page break here"}

In the above construction insert a page break where indicated between the
quote marks. You will have to build this manually using CTRL+F9 for the
field boundaries. And the actual result of the mergefield when inserted
normally must be "True"

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org




Risseecm wrote:
I need to insert a page break if a condition is true. For example,
if the Name field for the next record is different, print on a new
page, otherwise continue on the same page.



  #3   Report Post  
Risseecm
 
Posts: n/a
Default

Thank you, Graham. I'm guessing I don't actually type "insert a page break
here", but I don't know the code to type in for a page break. Can you help
with this?

"Graham Mayor" wrote:

{IF {Mergefield fieldname} = "True" "insert a page break here"}

In the above construction insert a page break where indicated between the
quote marks. You will have to build this manually using CTRL+F9 for the
field boundaries. And the actual result of the mergefield when inserted
normally must be "True"

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org




Risseecm wrote:
I need to insert a page break if a condition is true. For example,
if the Name field for the next record is different, print on a new
page, otherwise continue on the same page.




  #4   Report Post  
Greg
 
Posts: n/a
Default

Risseecm,

Graham meant to be taken literally. Remove the text -insert text break
here- from between the " " marks and with your cursor between the marks
actually insert a page break.

  #5   Report Post  
Risseecm
 
Posts: n/a
Default

Thanks, Greg. I've tried to insert a page break by pressing CTRL-ENTER and
by inserting it from the Insert menu and both methods simply move the text to
a new page rather than inserting a field code to activate when the condition
is true. I'm using Word 2003.

"Risseecm" wrote:

I need to insert a page break if a condition is true. For example, if the
Name field for the next record is different, print on a new page, otherwise
continue on the same page.



  #6   Report Post  
Greg
 
Posts: n/a
Default

RIsseecm,

Try this test.

Type True

Select it and bookmark with the name Test

Type this text IF Test = "True"""""

Select that and press CTRL+F9

Put your cursor between the first pair of empty speech marks and insert
a page break. InsertBreakPage Break

That is it. You need to physically insert the page break in the field
code. When you toggle the field code the break with appear in the
document as long as the condition Test is "True" if you change the
value of the condition and update the field the page break will not
appear in the document.

  #7   Report Post  
Risseecm
 
Posts: n/a
Default

Greg,

I tried the test you suggested and it again simply put a page break in my
typed text rather than inserting it after evaluating the formula. Here's my
formula:

{IF {MERGEFIELD "Supv_Name"}{SUPV} "New" "Same"}

{SUPV} is a stored value containing the current supervisor's name. I'm
trying to put the page break where I have typed New so that if the data shows
a supervisor that's different from the current value, the next data set will
print on a new page. I don't know if this matters, but I have this formula
in a table.

Any suggestions?



"Greg" wrote:

RIsseecm,

Try this test.

Type True

Select it and bookmark with the name Test

Type this text IF Test = "True"""""

Select that and press CTRL+F9

Put your cursor between the first pair of empty speech marks and insert
a page break. InsertBreakPage Break

That is it. You need to physically insert the page break in the field
code. When you toggle the field code the break with appear in the
document as long as the condition Test is "True" if you change the
value of the condition and update the field the page break will not
appear in the document.


  #8   Report Post  
Greg
 
Posts: n/a
Default

Risseecm,

That is how it works. Because the page break is in the field code,
when you toggle the field code the page break "will be there" IF the
condition is TRUE and "will not be there" IF the condition is false.

Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
insert "Section Break-Next Page" but get "Section Break (Odd Page. PsyGuy Page Layout 2 December 22nd 04 08:27 PM
How do I insert a page break before a table without inserting an . busyWP Tables 1 December 15th 04 04:41 PM
Odd page section break Jenny Page Layout 5 December 15th 04 08:05 AM
FIrst page footers Noel S Pamfree Microsoft Word Help 7 December 6th 04 08:49 PM
Finding/removing an "obascure" manual page break Fred Holmes Tables 2 November 5th 04 06:57 PM


All times are GMT +1. The time now is 12:50 PM.

Copyright ©2000 - 2023, Jelsoft Enterprises Ltd.
Copyright 2004-2023 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"