Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Amanda Byrne Amanda Byrne is offline
external usenet poster
 
Posts: 2
Default how to insert a row in existing table from within field code

I am creating a document for a nonprofit that will create letters for our
donors and show a summary of their donations. I've created a Directory Mail
Merge that prints a letter for each donor and uses an IF statement to
detemine whether to print another donation for the current donor, or move on
to the next donor. This worked well on just a text basis, but I would like
to print 4 different fields from my database for each donation, and really
need a table format to pull this off attractively.

The problem is that I need to create a new row in an existing table for each
additional donation, and my IF statement does not see quotation marks from
inside a table. How can I instruct Word to create a new row?

For more info on the IF statement structure, my document was created as per
this Word article example: http://support.microsoft.com/default.aspx/kb/294686

Thanks, Amanda

  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Cindy M. Cindy M. is offline
external usenet poster
 
Posts: 2,416
Default how to insert a row in existing table from within field code

Hi amanda,

In the mail merge FAQ on my website you'll find a summary of the "one-to-many"
(complex document) problem with links to sample files/articles. Look at the one
for using a DATABASE field.

I am creating a document for a nonprofit that will create letters for our
donors and show a summary of their donations. I've created a Directory Mail
Merge that prints a letter for each donor and uses an IF statement to
detemine whether to print another donation for the current donor, or move on
to the next donor. This worked well on just a text basis, but I would like
to print 4 different fields from my database for each donation, and really
need a table format to pull this off attractively.

The problem is that I need to create a new row in an existing table for each
additional donation, and my IF statement does not see quotation marks from
inside a table. How can I instruct Word to create a new row?

For more info on the IF statement structure, my document was created as per
this Word article example: http://support.microsoft.com/default.aspx/kb/294686


Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :-)

  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Amanda Byrne Amanda Byrne is offline
external usenet poster
 
Posts: 2
Default how to insert a row in existing table from within field code

Well, none of those methods are really adequate, or they require more time to
set up than is worth the effort.

The first suggestion won't work well for me as I'm working from a CSV
exported from an online database program, so I'd have to create a database to
go that route, and I might as well create a report in Access. Also the Leigh
Weber example link is non-functional.

The second suggestion is how I set up the document to begin with, and so is
not helpful with the table dilemma.

The third suggestion again seems to be best lined up with an existing Access
database which this is not.

The fourth suggestion again seems more labor intensive than importing into
Access and creating a report.

Thanks for the suggestions, I think I'll just try to find an acceptable way
to format the Word document without tables or temporarily import into Access
and set up a report.

Thanks, Amanda

"Cindy M." wrote:

Hi amanda,

In the mail merge FAQ on my website you'll find a summary of the "one-to-many"
(complex document) problem with links to sample files/articles. Look at the one
for using a DATABASE field.

I am creating a document for a nonprofit that will create letters for our
donors and show a summary of their donations. I've created a Directory Mail
Merge that prints a letter for each donor and uses an IF statement to
detemine whether to print another donation for the current donor, or move on
to the next donor. This worked well on just a text basis, but I would like
to print 4 different fields from my database for each donation, and really
need a table format to pull this off attractively.

The problem is that I need to create a new row in an existing table for each
additional donation, and my IF statement does not see quotation marks from
inside a table. How can I instruct Word to create a new row?

For more info on the IF statement structure, my document was created as per
this Word article example: http://support.microsoft.com/default.aspx/kb/294686


Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :-)


  #4   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default how to insert a row in existing table from within field code

Word is not really designed to work as you envisage, so you either have to
put up with the complexity or use Access.

--

Graham Mayor - Word MVP

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


Amanda Byrne wrote:
Well, none of those methods are really adequate, or they require more
time to set up than is worth the effort.

The first suggestion won't work well for me as I'm working from a CSV
exported from an online database program, so I'd have to create a
database to go that route, and I might as well create a report in
Access. Also the Leigh Weber example link is non-functional.

The second suggestion is how I set up the document to begin with, and
so is not helpful with the table dilemma.

The third suggestion again seems to be best lined up with an existing
Access database which this is not.

The fourth suggestion again seems more labor intensive than importing
into Access and creating a report.

Thanks for the suggestions, I think I'll just try to find an
acceptable way to format the Word document without tables or
temporarily import into Access and set up a report.

Thanks, Amanda

"Cindy M." wrote:

Hi amanda,

In the mail merge FAQ on my website you'll find a summary of the
"one-to-many" (complex document) problem with links to sample
files/articles. Look at the one for using a DATABASE field.

I am creating a document for a nonprofit that will create letters
for our donors and show a summary of their donations. I've created
a Directory Mail Merge that prints a letter for each donor and uses
an IF statement to detemine whether to print another donation for
the current donor, or move on to the next donor. This worked well
on just a text basis, but I would like to print 4 different fields
from my database for each donation, and really need a table format
to pull this off attractively.

The problem is that I need to create a new row in an existing table
for each additional donation, and my IF statement does not see
quotation marks from inside a table. How can I instruct Word to
create a new row?

For more info on the IF statement structure, my document was
created as per this Word article example:
http://support.microsoft.com/default.aspx/kb/294686


Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow
question or reply in the newsgroup and not by e-mail :-)



  #5   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Cindy M. Cindy M. is offline
external usenet poster
 
Posts: 2,416
Default how to insert a row in existing table from within field code

Hi Amanda,

The first suggestion won't work well for me as I'm working from a CSV
exported from an online database program, so I'd have to create a database to
go that route, and I might as well create a report in Access. Also the Leigh
Weber example link is non-functional.

Thanks for the heads up that this link is broken. It looks like Leigh isn't
providing that information, anymore. Guess I'll have to put up a sample on my
site, in that case. I've always wanted to give credit where credit is due, and
Leigh is the person who came up with the approach, but if that sample is no
longer available...

You don't need to create a database in order to use this; a csv file is just as
good a "database" as an Excel sheet or an Access database, for this purpose.

Display the Database toolbar, then use the Insert/Database button. It will be
like connecting to a mail merge data source. Explore the options the buttons in
the "Wizard" offer you, especially for formatting and querying.

Set the query to choose an existing record in the data file (any, doesn't matter
what, as long as it really exists). Query on a field that uniquely identifies
the record (the donor), usually, this would be an ID of some kind.

When you get to the last step, be sure to activate the little checkbox that
inserts the Database as a field. This will create a dynamic link to the
datasource. When you're done, you should see a table that contains the data for
the record you specified in the query options.

Now the trick is to substitute the equivalent MergeField for the static ID
value. If you could click in the table, press Shift+F9 to view the Database
field code, then select and copy the entire "SELECT...FROM...WHERE" part, paste
it into your reply, we can show you how to make that substitution.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :-)



  #6   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default how to insert a row in existing table from within field code

Thanks for the heads up that this link is broken. It looks like Leigh
isn't
providing that information, anymore. Guess I'll have to put up a sample on
my
site, in that case. I've always wanted to give credit where credit is due,
and
Leigh is the person who came up with the approach, but if that sample is
no
longer available...


I think either the same material or similar is now at

http://www.knowhow.com/DownloadWord.aspx

Peter Jamieson

"Cindy M." wrote in message
news:VA.00000938.01b59d3c@speedy...
Hi Amanda,

The first suggestion won't work well for me as I'm working from a CSV
exported from an online database program, so I'd have to create a
database to
go that route, and I might as well create a report in Access. Also the
Leigh
Weber example link is non-functional.

Thanks for the heads up that this link is broken. It looks like Leigh
isn't
providing that information, anymore. Guess I'll have to put up a sample on
my
site, in that case. I've always wanted to give credit where credit is due,
and
Leigh is the person who came up with the approach, but if that sample is
no
longer available...

You don't need to create a database in order to use this; a csv file is
just as
good a "database" as an Excel sheet or an Access database, for this
purpose.

Display the Database toolbar, then use the Insert/Database button. It will
be
like connecting to a mail merge data source. Explore the options the
buttons in
the "Wizard" offer you, especially for formatting and querying.

Set the query to choose an existing record in the data file (any, doesn't
matter
what, as long as it really exists). Query on a field that uniquely
identifies
the record (the donor), usually, this would be an ID of some kind.

When you get to the last step, be sure to activate the little checkbox
that
inserts the Database as a field. This will create a dynamic link to the
datasource. When you're done, you should see a table that contains the
data for
the record you specified in the query options.

Now the trick is to substitute the equivalent MergeField for the static ID
value. If you could click in the table, press Shift+F9 to view the
Database
field code, then select and copy the entire "SELECT...FROM...WHERE" part,
paste
it into your reply, we can show you how to make that substitution.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply
in the newsgroup and not by e-mail :-)



  #7   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Cindy M. Cindy M. is offline
external usenet poster
 
Posts: 2,416
Default how to insert a row in existing table from within field code

Hi Peter,

I think either the same material or similar is now at

http://www.knowhow.com/DownloadWord.aspx

Are you sure? I downloaded and looked in the ZIP file
yesterday and I couldn't find a sample for the Database
field, nor the explanation on how to use it...

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update
Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any
follow question or reply in the newsgroup and not by e-mail
:-)

  #8   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default how to insert a row in existing table from within field code

Hi Cindy,

Are you sure?


No, I wasn't sure. Sorry about that.

I've also often considered doing my own version of this but while the Leigh
Webber version was there it always seemed unnecessary.

If you're thinking of doing your own example, two things to bear in mind
a
a. sometime since Word 2000, Word can get confused when you use "Merge + a
table created via a DATABASE field" - it seems to treat the data source for
the one as the data source for the other. It doesn't always happen, and I do
not know the specific circumstances in which it happens. AFAIK MS is aware
of this problem but a solution seems unlikely.
b. sometime since Word 2000, using a DATABASE field to return a single,
scalar value inline with the text has also become less reliable because Word
now sometimes inserts a paragraph mark after the result. Again, this
behaviour only occurs sometimes (my guess is that something gets corrupted
somewhere as removing normal.dot and the data key seems to fix the problem
temporarily) but again, I don't know what triggers it.
This wouldn't affect the "multiple items per condition" use of the DATABASE
field but it makes the field generally less useful.

Peter J

"Cindy M." wrote in message
news:VA.00000948.006ab3db@speedy...
Hi Peter,

I think either the same material or similar is now at

http://www.knowhow.com/DownloadWord.aspx

Are you sure? I downloaded and looked in the ZIP file
yesterday and I couldn't find a sample for the Database
field, nor the explanation on how to use it...

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update
Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any
follow question or reply in the newsgroup and not by e-mail
:-)



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
Losing textbox on table Jack Tables 13 November 21st 06 03:09 AM
Creating multiple TOC HRobinson Page Layout 7 October 18th 06 02:12 AM
Insert a bookmark field [email protected] Microsoft Word Help 4 September 26th 06 04:34 PM
Need macro to locate table uniquely, insert blank row and date and end table Marrick13 Tables 4 July 1st 06 12:33 PM
How do I use the PRINT field code to ... Dave Microsoft Word Help 3 December 13th 04 03:06 PM


All times are GMT +1. The time now is 03:20 AM.

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"