View Single Post
  #4   Report Post  
Posted to microsoft.public.word.mailmerge.fields
RobGMiller RobGMiller is offline
external usenet poster
 
Posts: 6
Default Word Doc connected to Access Query

Thanks Peter and Doug,

I had not thought about many of your scenarios Peter,

I've since found that if the Doc is connected to an access table containing
a single record it will show its content. It does not work with a query for
some reason. So If I make the table prior to opening the document it works as
expected.

Because the second time I open the doc it showed the data from the first
opening I did not think it would be a problem to save the original document.
Now It will show the current table record everytime it is opened even if it
has been saved under a new name of course.

Ideally, I want to open the document minimized or hidden, then replace merge
fields with actual text from the current record and then save it to a new
name programatically before the user gets to edit it.

I really dont want the user to have to learn how to and remember the steps
in disconnecting the data source before saving.

It sounds like a tall order.

I will look at Albert Kalla's utility to see if there is anything in there I
can use.


--
RobGMiller


"Peter Jamieson" wrote:

OK, I'm not completely sure which particular problem(s) you need to solve
here.

How are you deciding which record to select? for example, do you have a
query that selects a single record?

Are you saying that the problem is that when the user opens the document,
they should see the current query result, but actually see the query result
they last saved?

Or are you saying that once the user has saved the document, when they
re-open it you want them to see the result they saved, but actually they are
seeing the current result?

(I think there are a few other possibilities but just let us know...)

Guessing that what you mean is that once the user has saved the document,
when they re-open it you want them to see the result they saved, there are a
few ways you could go, e.g.
a. get the user to "unlink" the fields before saving (ctrl-A then
ctrl-shift-F9), and they should probably also disconnect the data source,
then Save As - that's getting to be rather a lot so you'd probably need a
macro.
b. consider using a DATABASE field to insert the results. The user might
need to re-execute the database field (ctrl-A then F9, and to unlink the
results as in (a), they wouldn't need to disconnect the data source, but
they'd need to Save As)
c. get the user to perform the merge and save the resulting document. Or do
it from a Macro.

Since I'm not sure what you're really sasking there'ss little point in
offering any code (my stock is in any case rather limited) but if that
points you in the direciton you need to go, it may be worth your while
haveing a look around this group using Google groups.

Peter Jamieson

"RobGMiller" wrote in message
...
Office 2003,

I'd like to set a single record SQL in an access Query, or Table if
necessary, and then launch a word document which uses this data. I've set
the
doc up using the mail merge wizard. It works the first time but once the
document has been saved it returns the data from the original query the
next
time it is opened.

Simply put, the word doc will be used to display the query fields. The
user
needs to save this document using a different name.

In order to securely preserve the template, perhaps the doc can be saved
under a differnet formatted name and then opened with the correct current
query information.


Thanks in advance....

--
RobGMiller