I have an Access database from which I would like to print a MailMerge. The code I am using runs on a click event from a form in Access. It launche Word, opens the template into which the data is merged, and sucessfully completes the merge. The problem comes when I attempt to print the merged...
Play with the macrorecorder when doing that.
I'm sorry, I don't understand what you are asking me to do. Should I just eliminate the code that doesn't seem to work and complete the merge and printing manually? Or are you suggesting a macro from within Access to complete the task?
Bob
PH,
Word 97 SR2
What happens when you double-click AccessSurgRpt.dot in an Explorer window ?
--It opens to the template without merging the data, as I would expect. It does this through the code also. It gets that far and then the error message comes up. If I try to complete the merge from...
Adapting some code I got here last week for another database (in which it is working well) I am having a problem opening an Access database to do a mailmerge in Word. The database that can't be open is the one that is calling the mail merge. Here is the code with the porblem area in red...
PH and Paul,
The code that is presently working and doing very well is:
Public Function MergeIt1()
Dim odoc As Word.Document, objWord As Object
Set objWord = CreateObject("Word.Application")
objWord.Visible = True
Set odoc = objWord.Documents.Add("C:\Program Files\Microsoft Office\Templates\Lyme...
Paul,
I really thank you for the time you have put into assisting me in this bit of code.
In the Reference library I find 3 Microsoft ActiveX Data Objects 2.x Libraries. The program will only allow 1 of those to be checked at a time or it will yield a naming conflict error. They are 2.1...
I am getting an error "ActiveX component can't create object"
Public Function MergeIt()
Dim odoc As Word.Document
Set odoc = GetObject("C:\Program Files\Microsoft Office\Templates\LymePositive.dot", "Word Document")
odoc.MailMerge.OpenDataSource _
Name:="C:\My...
Paul,
I get an error with the Dim statement: "User defined type not defined".
Public Function MergeIt()
Dim odoc As Word.Document
Set odoc = GetObject("PathtoyourFormLetter", "Word Document")
odoc.MailMerge.OpenDataSource _
Name:="PathTo.mdbFile", _
linktosource: = True, _
connection:="QUERY...
I have never used the Shell function before, so I am not certain just how to get done what I need. I need to open Word from Access, then open a form letter template that gets its data from the Access database from which I am opening Word. Then merge the data and print the letters. I can open...
I'm really not sure why I have problems with this website, but I don't get all the replies to threads. I had to wait until I got home yesterday to get the last two posts.
hkaing79 asked about tblTempInv and the MoveLast. Actually that should have been removed when I used the Update statement...
It is still not working. I get an error saying the SQL statement is not correct because it lacks a 'SELECT'...or 'UPDATE'
Here is the code:
Private Sub Yes()
Dim db As Database, rst As Recordset, intResponse As Integer
Dim lngDrugID As Long, lngCaseNum As Long, datDate As Date
Dim sngmgUsed As...
I have a temp table, tblTempInv with 43 fields. This table is created each morning and inventory is added to it or subtracted from it numerous times each day. I need to be able to make those additions and subtractions in code to increase the security of the numbers, and prevent editing of the...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.