Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2012

    Unanswered: MS Access prevents Mail Merge when you have VBA Code

    Hi, I've noticed that if you try to mail merge a Word document with a query that has VBA code, it won't work.

    For example if I open the following query in datasheet view and use mail merge:

    SELECT myfunction(EmpTable.ID) FROM EmpTable will not work.

    I did about 50 things beforehand, including restarting my computer 10 times, compact and repair, deleting the word document files, renaming them, ending processess. No one them worked unless I changed my query so there is no VBA code.

    This is the query that works with a mail merge:

    SELECT EmpTable.ID FROM EmpTable

    anyone know of any way to solve this issue? Thanks!

  2. #2
    Join Date
    Nov 2004
    out on a limb
    Provided Answers: 59
    suspect its going to be a permissions issue. you may need to investigate if there is a way of telling the OS that the DB is trusted
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Jun 2012
    I forgot to mention, when I use a function in my query and I try to mail merge, it will give me a "XXX is locked for editing by 'another user' " error.

    edit: I've done enable trusted or whatever that yellow tab that pops up every time I open the database.

Posting Permissions

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