View Single Post
  #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 :-)