VBA in Word

Discussion in 'Software' started by Ldanix, Aug 14, 2006.

  1. Ldanix

    Ldanix Private E-2

    Hello,
    I am having some mailmerge trouble with Access and Word. I have a Form in Access with a button that triggers Word to open a document. That Word document has the following VBA in it to execute the mailmerge upon opening:

    Private Sub Document_Open()
    Me.MailMerge.OpenDataSource "\\calumet\apps\asset_tracking_system\Current Employee.odc"
    Me.MailMerge.ViewMailMergeFieldCodes = False
    Me.MailMerge.Destination = wdSendToNewDocument
    Me.MailMerge.Execute
    Me.Close
    End Sub

    The Access database is password-protected with "dimension4". When I click the button on the Access form, Word gives me the "Data Link Properties" box. I enter the password and Word creates a new "merged" document with this in it:

    Record 1 contained too few data fields.
    Record 2 contained too few data fields.

    I have removed the password from the database, and the merge works properly, but I need the password for security.
    Can anyone help me with the code that needs to be added to make this work?

    Thanks a million!
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds