Mail merge from an Access control

Al Kramer

Member
Local time
Today, 18:30
Joined
Jan 7, 2025
Messages
55
Hello again,

I have a query and a word mail mege doc. I can manually go through the mail merge steps to generate the merge.
What do I need to know/do in order to launch the mail merge from an Access control (probably from a switchboard)?
Thanx

Al
 
you can also create a Report in Access.
 
Hello

New to Access & having a problem Executing a Word mail merge from an Access button.
I have a Word Doc that I have successfully merged with an Access Query.
Google's AI provoded the following:

To run a Word mail merge from an Access macro, you would use the "DoCmd.TransferDatabase" command, specifying the "Word Merge" transfer type, selecting the desired Access table or query as the data source, and choosing the appropriate Word document to merge with; essentially, exporting your data to Word for mail merge functionality.

Example Access macro code:

Code
DoCmd.TransferDatabase acExport, "Microsoft Word", "YourTableName", "C:\Path\To\YourWordDoc.docx", "Word Merge"

Explanation:


  • DoCmd.TransferDatabase: This is the Access command to transfer data to another application.
  • acExport: Specifies that you want to export data.
  • "Microsoft Word": Indicates that you are transferring data to Microsoft Word.
  • "YourTableName": Replace this with the name of the Access table or query containing the data you want to merge.
  • "C:\Path\To\YourWordDoc.docx": Replace this with the full path to your Word document where you want to merge the data.
  • "Word Merge": This is the transfer type that initiates the Word mail
I could not figure out how to enter code with my parameters in a macro:
DoCmd.TransferDatabase acExport ,"Microsoft Word","QryMembersTest" , "C:\Users\akram\Documents\FolBkUp\FoL\MMtemp.docx",Word Merge"

So I tried it in the click event of a button but an error indicating Access didn't recognize DoCmd.



Any help appreciated

Al
 
Quite a bit of interesting ideas, but did not solve my problem.
Thanx
Al
 
I've never seen the method your attempting and I have no love for A.I. code, so good luck.
 
1. Create a Word template, adding you field names in the places where they need to be
2. Open a recordset with your query
3. For each record, open the Word template from Access
4. Run a Find and Replace routine to find your field names and replace them with their values according to your query
5. Save As another file, leaving the template intact for the next record
6. Done.
 
Last edited:
Show the exact message.
I do not have Word or Word Merge in 2019 ?
 
Hello

New to Access & having a problem Executing a Word mail merge from an Access button.
I have a Word Doc that I have successfully merged with an Access Query.
Google's AI provoded the following:

To run a Word mail merge from an Access macro, you would use the "DoCmd.TransferDatabase" command, specifying the "Word Merge" transfer type, selecting the desired Access table or query as the data source, and choosing the appropriate Word document to merge with; essentially, exporting your data to Word for mail merge functionality.

Example Access macro code:

Code
DoCmd.TransferDatabase acExport, "Microsoft Word", "YourTableName", "C:\Path\To\YourWordDoc.docx", "Word Merge"

Explanation:


  • DoCmd.TransferDatabase: This is the Access command to transfer data to another application.
  • acExport: Specifies that you want to export data.
  • "Microsoft Word": Indicates that you are transferring data to Microsoft Word.
  • "YourTableName": Replace this with the name of the Access table or query containing the data you want to merge.
  • "C:\Path\To\YourWordDoc.docx": Replace this with the full path to your Word document where you want to merge the data.
  • "Word Merge": This is the transfer type that initiates the Word mail
I could not figure out how to enter code with my parameters in a macro:
DoCmd.TransferDatabase acExport ,"Microsoft Word","QryMembersTest" , "C:\Users\akram\Documents\FolBkUp\FoL\MMtemp.docx",Word Merge"

So I tried it in the click event of a button but an error indicating Access didn't recognize DoCmd.



Any help appreciated

Al
Hi Al
Why not just do the Merge into an Access Report?
 
Al,

One additional option could be change your query to a make table and then you can use the table. Perhaps treat the table like a temp table which you can replace each time you need to do your mail merge.

Mike when were you in the signals? I did 18 years 1976 to 1994.
 
Al,

One additional option could be change your query to a make table and then you can use the table. Perhaps treat the table like a temp table which you can replace each time you need to do your mail merge.

Mike when were you in the signals? I did 18 years 1976 to 1994.
Hi Trevor
I was in from 1962 to 1995
Which Unit were you ?
 
A mix of units. Started with 216 Airbourne in Aldershot after junior leaders. Went to 7 Sigs then to 1 (BR) Corps for a good few years. 244 down in Brize Norton only for six month, then 262 in Cyprus for a couple of years. Then 204 in Munster (including the Gulf war) and finally in the MOD. Overall a great career and set me up with IT Skills which has seen me through my working career and in my retirement.

I'm sure they'll be some names we both would know!

Happy to hear about yours as well.
 
I was Comms & Sy Grp UK, 651 Sig Troop (Borneo), 13 Sig Regt, Sig Troop (Berlin), 226 Sig Sqn, 9 Sig Regt, 321 EOD Unit NI, 14 Sig Regt, 3 Sqn Berlin.
 
Hum 9 Sigs Cyprus? I was with 262 from 88 to 90. Wonder if you were around then?
 
Al,

One additional option could be change your query to a make table and then you can use the table. Perhaps treat the table like a temp table which you can replace each time you need to do your mail merge.

Mike when were you in the signals? I did 18 years 1976 to 1994.
I'm trying that as we speak... Thanx
 

Users who are viewing this thread

Back
Top Bottom