Super Easy Word Merge can't see subform contents

G

Guest

Sorry Albert, here I am with another query, so soon...
I have a Corporate Client Record table and form and have set up WordMerge to
provide a nicely laid out printout that salespeople can take when they're
going to make a visit.
I also have a separate table CorporateActivities that supports a subform on
the bottom of the Client Record form. The subform is laid out as a datasheet
and any phone calls, visits etc are recorded there - it's a typical contact
management record with data, user, subject, follow-up date.
I CANNOT get the contents of this subform and table to come out in WordMerge.
I have a separate form called Mergefields which is basically one big query,
collecting together all the data that I'm going to want WordMerge to pull
into one document or another. The subform fields appear there OK. The data is
being held in the relevant table fields. But when I try to add the subform
fields into the template, they're not listed!
I'm sure you'll be able to put me straight, thank you.
CW
 
A

Albert D. Kallal

Unfortunately, word merge does support placing "many" records into the
document.

among several problems would be how would you "define" the table in word.

What the above means is that you can't use the built in word merge for this
process.

The most easy solution is in your case to use a report...and print
that...either as a pdf, or rtf (which means word).

So, the best suggestion is to use a report..and not word.

However, there are some code examples that do show you how to place "many"
records into ONE document, but then you not using word merge anymore

I should point out that my code actually does NOT DO the word merge, but I
actually use words "built in" feature.

I am considering to add this "many" feature to word, but someone will have
to solve the following problems

a) How will the user layout the table in word...what tools, what kind
of interface will be used, how will fields be specified?

b) how will the user tell word "which" of those child records to use
(that means the user will have to specify some master to
child link system).

c) How to handle things like if a user places a merge field in the
middle of a paragraph, but that merge field is from the sub-form...what will
happen (or, what *should* happen).

d) since it is table, then right/left justification, and currency
formats are almost ALWAYS needed, and
again how will these settings be specifed?

So, MOST of this problem is not really a technical problem, but one of user
interface, and HOW WILL we make the user layout this table data. HOW WILL
the user specify the format. HOW will the user define if there is to be grid
lines, or not. And, even things like specifying the column heading...do we
allow that?

Since there not a feature in word that does this now, then training, and
some type of system would also have to designed to "train" users for this
problem.

If you look at my example, virtually ANY book that shows how to insert merge
fields into a document will work. Anyone who has ever used the built in word
merge will instantly be able to use my example, and the end user "sees" the
list fields to select form in a drop down combo.

This also why I avoided bookmarks in the document...I hate them, they are
REALLY hard to use an see in the document, and worse, end users don't get
presented with a list of fields that they can insert into the document
(they have to go look at the table design..and read, and then re-type the
field names as book marks....). And, even worse is that most bookmark
solutions requite to you WRITE NEW CODE for EVERY NEW document you make.
That is just un-acceptable to me.

I suppose I could come up some code example, but then "new" code would need
to be written for each new example, or case. I don't think it is right to
have a code example that you need to change for each new document. My posted
example works with any form..and for each new form you create, you DO NOT
have to write a bunch of new code. Can you imagine that for each new
document you create in word, you have to go back to Microsoft and have
developers code that document? This why I not posted a solution that allows
multiple data for the child forms, since it not a very honest solution to
provide a client with a solution that requites a programmer for each new
document. (some of my clients would consider this dishonest).

However, if you want to write code for each of these new documents you
create, then there is some "many" solutions posted here:


http://homepage.swissonline.ch/cindymeister/MergFram.htm

look on the left side for special merges. The one you want is

Multiple items per condition

If someone can write out, or come up with a way to specify those tables in
word, and make this user friendly, and actually make it like my solution in
which NO NEW code need be written for EACH NEW document created..then I am
all ears.... (I am working on this problem..but, I don't have a solution
yet).
 
A

Albert D. Kallal

Do note that if you only need ONE record that includes all of the main
record, and ONE particular
record from the sub-form, then you can accomplish this.

Simply use your query, and go:

dim strSql as string

strSql = "select * from Myquery where id = " & me!id

MergeAllWord strSql
 
G

Guest

Hmm... a bit of a challenge there, I can see that.
One thing though, I'm wondering if perhaps I didn't explain things clearly
enough - the activities record (on the subform) is purely for the one record
i.e. the company on the "main" form. It's not for "many" in that sense of the
word.
So the data all relates to one and the same client company - the main form
carries all the static info about the company, and the subform (in datasheet
format) contains the various entries about contact with them, with a separate
row consisting of date, subject, user.
Was that the way you understood it, or did I give the impression that I was
trying to pull info on multiple companies all at the same time?
And, critically, does that make it any more feasible?!
Thanks again
CW
 
A

Albert D. Kallal

Hmm... a bit of a challenge there, I can see that.
One thing though, I'm wondering if perhaps I didn't explain things clearly
enough - the activities record (on the subform) is purely for the one
record
i.e. the company on the "main" form. It's not for "many" in that sense of
the
word.
So the data all relates to one and the same client company - the main form
carries all the static info about the company, and the subform (in
datasheet
format) contains the various entries about contact with them, with a
separate
row consisting of date, subject, user.
Was that the way you understood it, or did I give the impression that I
was
trying to pull info on multiple companies all at the same time?
And, critically, does that make it any more feasible?!

Yes, see my other post. Simply built that query (or, use the one you made).

In a button on the main form...you just then go:

dim strSql as string
strSql = "select * from YourCoolQuery where id = " & me!id
MergeallWord strSql

Of couse, the above is going to return a record for EACH of the sub-form
reocrds. If you want to merge the currently selected
sub-form, then go:

dim strSql as string
strSql = "select * from YourCoolQuery where subFormFieldNameid = " &
me.MySubForm.form!SubFormfieldID
MergeallWord strSql


So, yes...you can use a query to replace the forms data source.....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top