Results 1 to 4 of 4
  1. #1
    New Lounger
    Join Date
    Jan 2002
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    mailmerge probs (97)

    I have used the code at the bottom of the page to open a template for a mailmerge that uses data from the table "tblMailMerge". It runs and opens the merged doc OK but I am having 2 Intermittent problems with Access.

    1. Access will shut down the database and lock me out, can only close the empty application through "task manager"
    2. Another copy of Access with the database is opened (the Application Title is set to Microsoft Access)

    Does anybody know if it is the code that may be causing this or whether it could be Microsoft problems, I have SR2 on Access but not sure if there are any more updates. Any kind of help would be a life saver [img]/forums/images/smilies/smile.gif[/img]

    Code Used:

    Public Function MailMerge()

    Dim oApp As New Word.Application
    Dim oMainDoc As Word.Document
    Dim stMergeDoc As String

    stMergeDoc = "C:" & varOutput

    Set oMainDoc = GetObject(stMergeDoc, "Word.Document")
    oMainDoc.MailMerge.OpenDataSource Name:="", Connection:="DSN=PlumbsV2.2", SQLStatement:="SELECT * FROM tblMailMerge"

    With oMainDoc
    .MailMerge.Execute Pause:=False
    End With

    oMainDoc.Application.Visible = True

    End Function

  2. #2
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    USA
    Posts
    379
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: 2nd instance of Access

    For information on the mail merge opening a second instance of Access, check out the following Knowledge Base article Mail Merge to Word Opens Another Instance of Access Q199963

  3. #3
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,624
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: mailmerge probs (97)

    In addition to the knowledge base article ThomasW pointed you to, there is an issue with Word Mail Merge documents remembering the data source you used the last time a merge was done. What we typically do to get around that is to remove the data souce info in Word, save the document, and then mark it "Read Only" using Windows Explorer (or DOS <img src=/S/crazy.gif border=0 alt=crazy width=15 height=15>). We also close the main merge document as soon as the merge is complete, and tell it not to try to save. Word merges can be a source of serious frustration when they misbehave, but they are a very powerful tool.
    Wendell

  4. #4
    New Lounger
    Join Date
    Jan 2002
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: 2nd instance of Access

    Cheers for that, the article is helpful and may have iliminated the problem of another Application being opened, just need to sort out why Access is crashing and locking me out now [img]/forums/images/smilies/smile.gif[/img]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •