Mail Merge Question

rich2912

New member
Local time
Today, 10:14
Joined
Dec 15, 2003
Messages
6
I have made a query in access that takes the value of a list box and on that value, it shows the appropriate results.

This value is a course ID, (as in a college course). I want to be able to send a letter to everyone on a specific course, using the same word template with the students name, adress and course etc. Leaving me a blank letter to fill in the text.

I have created a combo box that displays the list of courses and have put the value [forms]![gen_letter]![cmbcourse].[value] under the course ID in the query.

In other cases, when the course is selected and the query is run the results are filtered to just the course I selected in my combo box.

However, when I merge out to word with this method, a box comes up when word opens asking the value of "[forms]![gen_letter]![cmbcourse].[value]", if I type in the course ID it does filter, but I don't want this to happen. I want it to pick up the information from the combo box as it always does within access.

I am assuming this happens because Access is no longer in the foreground; word is. Is there any way to get it to run the query and pick up the information from the combo box.

The code I am using for the "submit" button on my form is as follows:

Private Sub cmdletter_Click()
Dim oApp As Object
Dim pos As Integer
Dim filename As String
pos = InStrRev(CurrentDb.Name, "\")
filename = Left(CurrentDb.Name, pos) & "QSUER Documents\Generic Letter.doc"
Set oApp = CreateObject("word.application")
oApp.Visible = True
Set objword = CreateObject("word.basic")
objword.fileopen filename
End Sub

Any help is much appreciated, thanks.
 
Thanks for the reply, I have already gone through that as it came up on an internet search, but does not seem to help me, or I cant make sense of it. One of the two. Has anyone ever had to do this?

i.e Pick a variable such as age, course, weight etc from a combo box to then merge into word with only the people under the selected criteria showing? This can be done within access but as soon as I go into word for a mail merge, it is unable to perform the task.
 

Users who are viewing this thread

Back
Top Bottom