简体   繁体   中英

Pass data from form in Access to mail merge in Word

Stuck on this thing.

Problem is: it is not a simple table, but a query with multiple parameters, so how I can pass the result of this query when user fill the form in Access and hit submit - open Word prepared file with mail merge?

I just got open Word document letter template with popup windows asking for parameter values. I don't see these queries qith params in list of available tables and queries in Word using wizard for mail merge.

Talking about Office 2013.

Since it probably hasn't a nice and direct solution, I have found one simple workaround.

After form is send, export current state of query to some file, in case of rtf file it could looks like:

DoCmd.OutputTo acOutputQuery, "Name of the query", acFormatRTF, "Path and name of output file"

Manual to the DoCmd.OutputTo .

Now you can use this file in mail merge as usual. Everytime new form is submited, file is updated so you always get actual data, same result as using query directly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM