View Single Post
  #1   Report Post  
Brian Alley
 
Posts: n/a
Default Mail Merge not running properly from Access Function but runs properly when opened manually

Here's the deal:
All of this is using the Office 2000 Suite.
We've got an Access db in which we've got a button setup to open a
particular document in Word and populate the Word document with information
from a query contained in the db.

Once the document opens, the access query runs and populates the document
via Mail Merge. The problem lies in that when you use the button to open
the document, the results of the query aren't "refreshed" into the document.
(It pulls old data - one record set in particular over and over and over
again). If you go and look at where it's pulling the information from in
Access, the record set that the document is referring to isn't listed. We
have a query setup to pull the desired information and the Word document
just looks at the qry when it opens. If you look at the qry results before
opening the document via the button, it contains the current information.

If, however, you go and manually open the document, you get an alert that
the query needs to run for proper use of the document. After allowing the
document to run the query, the document is then properly populated with the
correct information.

I've gone around and around. From what I can tell, the problem lies in the
word document as we're simply calling a function to open the document with
the desired filename. The qry is pulling the correct info before and after
opening the document - its just that the document isn't populating itself w/
the query results when its opened via the code in access.

Thanks for the help!