Reply
 
Thread Tools Display Modes
  #1   Report Post  
Frustrated
 
Posts: n/a
Default How to reference a repeated field entry in a previous record

I figured out an easy way to refer back to the previous record in a merge so
as not to enter the same information twice.

I set up a column in the spreadsheet next to the column holding the field I
wanted to reference. I then used the "EXACT" formula to compare the field
text in the record above with the one below to see if they were the same
(i.e. TRUE) or different (i.e. FALSE) I then copied the formula all the way
down the column.

Then I used the 'IF-Then-Else" field in my Word merge document: {IF
{Mergefield TFC} = "FALSE" "{Mergefield Country}" " "}.

Works like a charm!

Thankfully, I will not need to use a macro to go back and delete the
unwanted repeated text.
  #2   Report Post  
macropod
 
Posts: n/a
Default

Hi,

You could build the logic for this into the Word mailmerge document itself,
thus avoiding the need to edit the spreadsheet.

To do this, you could use a SET field to save the value of the previous
record, and a REF field to access that value before updating with the new
value.

You might need to do something special for the first record, along the lines
of:
{IF {MERGEREC}= 1 {SET oldvalue ""}}

From then on, to test the "old" value, you could use:
{IF{Mergefield TFC} = {oldvalue} {Mergefield Country}}

Having done that, you update the "old" value with the "new" value:
{SET oldvalue {MERGEFIELD TFC}}
for use in the next record.

Cheers


"Frustrated" wrote in message
...
I figured out an easy way to refer back to the previous record in a merge

so
as not to enter the same information twice.

I set up a column in the spreadsheet next to the column holding the field

I
wanted to reference. I then used the "EXACT" formula to compare the field
text in the record above with the one below to see if they were the same
(i.e. TRUE) or different (i.e. FALSE) I then copied the formula all the

way
down the column.

Then I used the 'IF-Then-Else" field in my Word merge document: {IF
{Mergefield TFC} = "FALSE" "{Mergefield Country}" " "}.

Works like a charm!

Thankfully, I will not need to use a macro to go back and delete the
unwanted repeated text.



  #3   Report Post  
Frustrated
 
Posts: n/a
Default

Thanks for the tip....I'll give it a try!

"macropod" wrote:

Hi,

You could build the logic for this into the Word mailmerge document itself,
thus avoiding the need to edit the spreadsheet.

To do this, you could use a SET field to save the value of the previous
record, and a REF field to access that value before updating with the new
value.

You might need to do something special for the first record, along the lines
of:
{IF {MERGEREC}= 1 {SET oldvalue ""}}

From then on, to test the "old" value, you could use:
{IF{Mergefield TFC} = {oldvalue} {Mergefield Country}}

Having done that, you update the "old" value with the "new" value:
{SET oldvalue {MERGEFIELD TFC}}
for use in the next record.

Cheers


"Frustrated" wrote in message
...
I figured out an easy way to refer back to the previous record in a merge

so
as not to enter the same information twice.

I set up a column in the spreadsheet next to the column holding the field

I
wanted to reference. I then used the "EXACT" formula to compare the field
text in the record above with the one below to see if they were the same
(i.e. TRUE) or different (i.e. FALSE) I then copied the formula all the

way
down the column.

Then I used the 'IF-Then-Else" field in my Word merge document: {IF
{Mergefield TFC} = "FALSE" "{Mergefield Country}" " "}.

Works like a charm!

Thankfully, I will not need to use a macro to go back and delete the
unwanted repeated text.




  #4   Report Post  
Frustrated
 
Posts: n/a
Default

Thank you...it worked! However, it was even simpler than your suggestion.

I used the SET field at the end of my merge codes to define the reference,
and the IF THEN ELSE field to determine the change in Country name:

{IF {MERGE REC} = 1 "{MERGEFIELD Country}" "{IF {MERGEFIELD Country} =
"{Oldvalue}" " " " {MERGEFIELD Country}"}"}

{SET Oldvalue "{MERGEFIELD Country}"

I had tried something similar earlier, but had used my "SET" field BEFORE
the "IF THEN ELSE" field which negated the results.

Now it works like a charm without altering my spreadsheet!



"macropod" wrote:

Hi,

You could build the logic for this into the Word mailmerge document itself,
thus avoiding the need to edit the spreadsheet.

To do this, you could use a SET field to save the value of the previous
record, and a REF field to access that value before updating with the new
value.

You might need to do something special for the first record, along the lines
of:
{IF {MERGEREC}= 1 {SET oldvalue ""}}

From then on, to test the "old" value, you could use:
{IF{Mergefield TFC} = {oldvalue} {Mergefield Country}}

Having done that, you update the "old" value with the "new" value:
{SET oldvalue {MERGEFIELD TFC}}
for use in the next record.

Cheers


"Frustrated" wrote in message
...
I figured out an easy way to refer back to the previous record in a merge

so
as not to enter the same information twice.

I set up a column in the spreadsheet next to the column holding the field

I
wanted to reference. I then used the "EXACT" formula to compare the field
text in the record above with the one below to see if they were the same
(i.e. TRUE) or different (i.e. FALSE) I then copied the formula all the

way
down the column.

Then I used the 'IF-Then-Else" field in my Word merge document: {IF
{Mergefield TFC} = "FALSE" "{Mergefield Country}" " "}.

Works like a charm!

Thankfully, I will not need to use a macro to go back and delete the
unwanted repeated text.




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
How do I reference the most recent entry in table? Heather Delezen Microsoft Word Help 1 May 10th 05 10:15 AM
Having multiple form fields automatically updated jrwaguespack Microsoft Word Help 3 March 25th 05 07:43 AM
Page x of y problems Cowtoon Microsoft Word Help 7 March 15th 05 04:28 PM
Mark Index Entry Cross Reference Trouble thelisha Page Layout 1 January 11th 05 08:18 PM
Text Form Field Ref in Footer Won't Update on Screen StarWine Microsoft Word Help 3 December 6th 04 06:17 PM


All times are GMT +1. The time now is 07:36 PM.

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

About Us

"It's about Microsoft Word"