Automate Mail Merge Function From Access Database

Apr 23, 2013

I have a database, i need to automate mail merge function from access DB to insert selected records into the merge fields, i have tried everything i could and i have searched through out the web nothing really works for me.

View Replies


ADVERTISEMENT

Automate Mail Merge From Access

Oct 11, 2006

Hi,

I have created a mail merge from a query in Access and it works fine if you run it from word but I would like to know how to automate the mail merge from Access using the Command button. Please can someone advise.

Thanks

Alex

View 5 Replies View Related

Automate Mail Merge From Command Button

Feb 7, 2005

Hey guys,

I have spent a while surfing around the site for the answer to this problem but to no avail.

I have a form with a command button which when pressed opens a Word Document. It's a mail merge template and I want to be able to automate the actual merge (merge to new a new Word document) as soon as the Word document opens.

Any help with this would be greatly appreciated. I am using the code below and cannot get the objWord.MailMerge.Execute line to work.

Rusty
:D

Private Sub cmdOK_Click()

On Error GoTo Err_cmdOK_Click

' Declare variables
Dim db As DAO.Database
Dim qdf As DAO.QueryDef
Dim varItem As Variant
Dim strCriteria As String
Dim strSQL As String

'Dim objWord As Word.Document

' Get the database and stored query
Set db = CurrentDb()
Set qdf = db.QueryDefs("qryMultiSelect")
' Loop through the selected items in the list box and build a text string
For Each varItem In Me!lstTrials.ItemsSelected
strCriteria = strCriteria & ",'" & Me!lstTrials.ItemData(varItem) & "'"
Next varItem
' Check that user selected something
If Len(strCriteria) = 0 Then
MsgBox "You did not select any Trials from the list." _
, vbExclamation, "Nothing to find"
Exit Sub
End If
' Remove the leading comma from the string
strCriteria = Right(strCriteria, Len(strCriteria) - 1)
' Build the new SQL statement incorporating the string
strSQL = "SELECT * FROM Trials " & _
"WHERE Trials.[Name of Trial] IN(" & strCriteria & ");"
' Apply the new SQL statement to the query
qdf.SQL = strSQL

' Open the MailMerge template
Call Shell("""C:Program FilesMicrosoft OfficeOfficeWINWORD.EXE"" ""O:ASWCSRecruitment dataCTU Cancer Trial Monthly UpdatesMonthlyUpdateTemplate.doc""", 1)

'objWord.MailMerge.Execute

' Empty the memory
Set db = Nothing
Set qdf = Nothing

Exit_cmdOK_Click:
Exit Sub

Err_cmdOK_Click:
Resume Exit_cmdOK_Click

End Sub

View 11 Replies View Related

Mail Merge Using Access Database Fields?

Feb 28, 2006

I think the title describes best what I want to do. I need to send a letter to some lets say receivers, who fulfill certain criteria, and who appear in a data field in an access database. The letter is common for everyone with the difference of course of their address and name. I am sure this is an easy one for the most of you....

Thanx in advance, Kyriakos
p.s. sorry for misspelling some words...

View 1 Replies View Related

Mail Merge Database

Sep 24, 2004

Can some on explain to me what I need to install and how to send a personalized mail merge from Access. I would like to use the names and email addresses from my database to send individual emails to everyone in it. Where do I find the proper add on? Thanks alot. Alex

View 3 Replies View Related

Mail Merge From Database To Multi Members

Jan 3, 2006

Hello,
i am creating a database for a membership of my martial arts academy, so far i can add and search members.

i would like to have a mail merge feature on this, so that i have a list of all the people with a check box next to their name, if the box is ticked their name is added to the mail merge. if its not ticked its not added.

All help is much appreciated.

Aaron.

View 4 Replies View Related

Mail Merge Opening Another Copy Of Database

Dec 11, 2006

Hey Guys,

Hope you can help as this one's got me stumped!

I'm using Access 2000 and run a mailmerge function via a button on a form. (It opens Word, which then uses a query in the database to refer to and then 'automerges' into a new Word document).

It used to work absolutely fine but now it opens Word and then opens another copy of the database (so I have 2 running) and all hell breaks loose.

Any ideas what I can do to stop this? Has anyone come across this before?

Any help/suggestions would be gratefully recieved as I feel like I'm in a 'needle in a haystack of needles' situation here.

Cheers,

Rusty
:D

View 2 Replies View Related

Microsoft Word Mail Merge - On Database Switchboard

Mar 9, 2008

I've got a mail merge letter in word using a booking system which I've built in Access, and I want to be able to access the mail merge letter (or the letter template) through that switchboard. Is this through running a certain macro, and if so, can anybody tell me what it is?

View 1 Replies View Related

Mail Merge And Access

Dec 7, 2005

Hi, could anyone teach me how to do this? Thanks in advance!

Here is the result of a query I have:

PersonEmail ProductAmountCategory
AA@hotmail.comApple10Fruit
AA@hotmail.comOrange20Fruit
AA@hotmail.comPen30Office
BB@hotmail.comApple15Fruit
BB@hotmail.comOrange25Fruit
BB@hotmail.comPen35Office
CC@hotmail.comApple18Fruit
CC@hotmail.comOrange28Fruit
CC@hotmail.comPen38Office

What I need to do is the develop a report, in a format like:

Person:A

Category
FruitAmountOfficeAmount
Apple10Pen30
Orange20
Total30Total30




Do this for A,B,and C and send the individual report in via email to them. To me it looks like a mail merge, but I don't know how to manipulate the data and put it into the layout. My real data has a lot of data, about 100 person, and about 60 product that falls into two categories. Is there anyway easy and fast way to do this? Please help! Thank you very much!

View 2 Replies View Related

Access Mail Merge

Nov 19, 2004

I am using a query for a word mail merge and would like to maintain the formating from Access into Word. Is this possible and if so how. If not, anyone have a clue how to do it in Word... I am importing the date and would like it to be long version (Friday, November 19, 2004) and it's giving me the short version (11/19/04),

Thanks and have a great weekend!

View 2 Replies View Related

Mail Merge - Access

Jul 25, 2007

I am wanting to create letters in word to go out to trainees which lists the courses they are booked on. I have successfully created a query which has a parameter under the 'Trainee ID' field, where I put in the trainee ID number and the query pulls out the courses that particular trainee is on. However, when I try to mail merge this into word, it works well BUT...insists on creating a new document/letter for each course the person is booked on.

What I wanted was for it to list the courses below the trainee name but can't for the life of me get it to do this

Anyone got any ideas ? I would appreciate any help with this

View 1 Replies View Related

Any MS Access Mail Merge Experts Around?

Jun 11, 2005

I am trying to merge data with MS Word, but am getting problems. I
only seem to be able to merge a single record. Can anyone help pls as this
is quite urgent


Thanks


barnettpaul@gmail.com

View 2 Replies View Related

Mail Merge With Access & Word

Aug 17, 2007

I want to use an Access Table for a mail merge but when i try to use the merge option I get a pop up asking for a password. I put in my administrator password for the database and it tells me I dont have acess to the database. It has something to do with the passwords i put on the database.


Anyone have any ideas to what I need to do to get this to work?

View 1 Replies View Related

Optimize Mail Merge With MS Access

Feb 11, 2008

Currently there is a MS Word application that runs a MS Access query to generate data for the Mail Merge with a document.

Does anyone have a suggestion as to how this process can be optimized? Specifically, looking to reduce the amount of time required to produce letters (best practices).

Thanks.

View 1 Replies View Related

Mail Merge Using Access Query

Jan 3, 2005

Happy New Year everyone-- I am trying to use an Access query to create mailing labels- Is there anyway to keep them alphabetized or sorted?

Thanks!

View 3 Replies View Related

Access Mail Merge Question

Jan 15, 2005

Hello- I am building an access database for a non- profit that does alot of mailings. My question is how to handle the people that live in the same house- ie: John and Mary Smith? Both have their own entry in the database, but I want to be able to send them one mailing to John and Mary Smith, rather than two addressed to each individually. Addressing the mailings to "Residents of", or something similar is to impersonal as many of them are donors.
Any good ideas how to handle this?
Thanks for any help!

View 1 Replies View Related

Re Access Mail Merge ...desperate!

Feb 27, 2005

I have numerous word docs that I need to mail too. What I am tring to acheive is how to link an active record that has been entered on a input form by the user to the various word docs as corressponding letters. This is how the user currently chooses which letter to use However, they are obviously entering the data manually as there is no merge facility.

The merge data is stored in a query called "QryMerge" is there any VB code that I could add to this

Private Sub cboReport_Change()
On Error GoTo Err_Handler
Dim stDocName As String

If [cboReport] = "L1" Then
Dim taskid As Long
Dim str As String
str = "winword.exe " & "D:DataFrm_L1.doc"
taskid = Shell(str, vbMaximizedFocus)

ElseIf [cboReport] = "L2" Then
str = "winword.exe " & "D:DataFrm_L2.doc"
taskid = Shell(str, vbMaximizedFocus)

ElseIf [cboReport] = "M" Then
str = "winword.exe D:DataFrm_M.doc"
taskid = Shell(str, vbMaximizedFocus)

ElseIf [cboReport] = "N1" Then
str = "winword.exe D:DataFrm_N1.doc"
taskid = Shell(str, vbMaximizedFocus)

ElseIf [cboReport] = "N1A" Then
str = "winword.exe D:DataFrm_N1A.doc"
taskid = Shell(str, vbMaximizedFocus)

ElseIf [cboReport] = "N2" Then
str = "winword.exe D:DataFrm_N2.doc"
taskid = Shell(str, vbMaximizedFocus)

ElseIf [cboReport] = "N3" Then
str = "winword.exe D:DataFrm_N3.doc"
taskid = Shell(str, vbMaximizedFocus)

ElseIf [cboReport] = "O" Then
str = "winword.exe D:DataFrm_O.doc"
taskid = Shell(str, vbMaximizedFocus)

ElseIf [cboReport] = "P1" Then
str = "winword.exe D:DataFrm_P1.doc"
taskid = Shell(str, vbMaximizedFocus)

ElseIf [cboReport] = "P2" Then
str = "winword.exe D:DataFrm_P2.doc"
taskid = Shell(str, vbMaximizedFocus)

ElseIf [cboReport] = "R" Then
str = "winword.exe D:DataFrm_R.doc"
taskid = Shell(str, vbMaximizedFocus)

ElseIf [cboReport] = "S" Then
str = "winword.exe D:DataFrm_S.doc"
taskid = Shell(str, vbMaximizedFocus)

ElseIf [cboReport] = "T" Then
str = "winword.exe D:DataFrm_T.doc"
taskid = Shell(str, vbMaximizedFocus)

ElseIf [cboReport] = "U" Then
str = "winword.exe D:DataFrm_U.doc"
taskid = Shell(str, vbMaximizedFocus)

ElseIf [cboReport] = "V" Then
str = "winword.exe D:DataFrm_V.doc"
taskid = Shell(str, vbMaximizedFocus)

ElseIf [cboReport] = "W1" Then
str = "winword.exe D:DataFrm_W1.doc"
taskid = Shell(str, vbMaximizedFocus)

ElseIf [cboReport] = "W2" Then
str = "winword.exe D:DataFrm_W2.doc"
taskid = Shell(str, vbMaximizedFocus)

ElseIf [cboReport] = "W3" Then
str = "winword.exe D:DataFrm_W3.doc"
taskid = Shell(str, vbMaximizedFocus)

ElseIf [cboReport] = "X" Then
str = "winword.exe D:DataFrm_X.doc"
taskid = Shell(str, vbMaximizedFocus)

Exit Sub
Err_Handler:
Beep
MsgBox "You have cancelled this message."

Exit Sub

End If
End Sub

I Would also be greatful for any help on how to convert a tick box on an access form to dislay ticked/unticked in a wordmerged doc.

Regards, Steve

View 14 Replies View Related

Automating A Mail- Merge In Access

Apr 18, 2006

I'm using a query that selects all customers from a Customer table who haven't made any payments for a particular week and then sends a letter to them.
I would like to use a command button on a form which the user can press and then view the letters for all the customers- they would only have to specify the week.
Is this possible?
Thanks

View 3 Replies View Related

Mail Merge From Access To Word?

Feb 18, 2015

I am preparing a Word document for a mail shot, and need to import data from my access file. I am trying to build a formula that will take a field from the Access file and, if it is true, print some data.

So far, I have =IF(Schedule 2014=40,full page). Schedule 2014 is a column in the query I am using in this mail merge, 40 is an amount of money in that column and full page is the text that should appear in the Word document. The result I am getting is!Syntax Error, 2014 .

The remainder of the information I am merging is working well. I am asking for the 40 to appear in the relevant recipient's letter which is fine, but I want it to print full page before it (or half page for 30, or quarter page for 20)

View 1 Replies View Related

Modules & VBA :: Mail Merge - Database Placed In A State By User That Prevents It From Being Opened Or Locked

Jun 19, 2014

I have the following code which errors on line

Code : .OpenDataSource Name:=CurrentProject.FullName, SQLStatement:="SELECT * FROM [qryMailMerge]"

The error (Error has occurred: The database has been placed in a state by user 'Admin' on machine 'W74XXXXXX' that prevents it from being opened or locked) appears in the Word document.

Code:
Public Sub CreateWordToPDF(strWordFile As String, strPDFFile As String, strSQL As String)
'Call CreateWordToPDF("C:Doc1.doc", "C:Doc1.pdf", "SELECT * FROM [qryMailMerge]")

Dim objWord As Word.Application
Dim docWord As Word.Document
'Open MS Word using early binding.
Set objWord = New Word.Application
Set docWord = objWord.Documents.Open(strWordFile)

[Code]......

View 8 Replies View Related

Mail Merge From Access D/B Changes Date To USA Format

Jul 13, 2005

Lads,

Here's a little problem that is driving me nuts. I know what is wrong and yet I can't fix it!

I have an Access D/B and a mail merge word doc which gets its data from a table in the database. Now the date is in the correct format in the table i.e. uk/european format. The 5 of january 2005 would be 05/01/2005.

However when this gets into the word doc it changes to USA format i.e. 01/05/2005.

Not very desireable! how do I fix it?

Thanks in advance,
Liam

View 4 Replies View Related

Can I Mail Merge Word 97 With Access 2003?

Aug 22, 2006

I am wanting to do away with access 97 on a few computers here at work but we cant afford to buy everyone office 2003. Before I buy us access 2003 for a computer I need to know if word 97 will do a mail merge with access 2003. Or could I just buy Office 2003 package for the few computers and it will work that way for a bit more money. I think there would be a compatability issue...

View 3 Replies View Related

Some Advide - Access To Word Mail Merge

Nov 24, 2006

I have done several mail merges where you open Microsoft Word, select your data (inthis case a query from access) and them use mail merge to create the documents.

However, i need to do it the other way. I have a project in access where the user will be in access and need to do a mail merge to word, so i want the data to be sent from access to word while they are still in access, if that makes sense.

If there are any good turorials that ppl know about or what i could be looking for in order to achieve this then i would be very grateful to all who reply!!

Thanks

View 3 Replies View Related

Disappearing Zeros In Mail Merge From Access

Apr 30, 2007

Hi all,

I have been trying to move some of my employer's database information from Excel to Access. The fields are simple stuff, first name, last name, address, etc. My only problem is the Amount Owed section in which I would have to put amounts such as 1270.70. In Access, I formatted the field as currency with 2 decimal places. Thus, it shows up as $1270.70 in the Access database.

However, when I mail merge the field to the letter, I only see 1270.7. I could not seem to make that last 0 appear. How could I make the 0 appear?

Further, as I have said, I have been moving records from Excel to Access. For mail merge purposes, would you recommend Excel or Access?

Thanks!

View 1 Replies View Related

Forms :: Mail Merge From Several Access Tables

Oct 16, 2013

I am pretty new to the using of Microsoft Access. Part of my role at work is to mantain a register of contacts (Aprox 2000 records). When moving into my role there was already an Access Database in place that had been designed and created by another member of staff prior to leaving.

The database contains a wealth of information, however this is spread across MULTIPLE tables (23 to be exact)

I am trying to create a word document that is basically a mail merge in order for me to drag the contact information over to print. However all the information I require is not in one table. Word will only extract the data from one source.

View 8 Replies View Related

General :: MS Publisher And MS Access Mail Merge?

Feb 22, 2013

I am running windows 7 and access 2007 same with pub When I do a mail-merge from pub I can see some Queries but not all. and thoughts?

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved