locked
access 2007 word mail merge: opendatasource sqlstatement limits RRS feed

  • Question

  • Hi there, i am performing a mail merge from Access to Word using VBA. I am merging with a table in Access but would like to use an "Order By" statement. However, when I add it to the SQLstatement part of the opendatasource command, it can't process the sqlstatement and a message box pops up asking me to identify which table i want to use. Is it possible to use the order by in the sqlstatement? I can't find any detailed information on what the sqlstatement can and can't contain for it's terms.
    Wednesday, November 4, 2009 1:25 PM

Answers

  • Hi,

    Sorry for a delayed response.

    For documentation on the SQLstatement used in MailMerge you could refer this article. A possible resolution to the issue is to use SQLStament2 (the query is above 255 characters).

    Also, if you would like to acheive this using the GUI you could use the sort functions available as described here.

    Please let me know if you have any questions.

    Thanks,
    Avinash.
    Thursday, November 19, 2009 1:35 AM
    Moderator

All replies

  • Hi,

    I have starting working on this issue and will get back to you shortly.

    Thanks,
    Avinash.
    Thursday, November 5, 2009 4:05 AM
    Moderator
  • Hi,

    Sorry for a delayed response.

    For documentation on the SQLstatement used in MailMerge you could refer this article. A possible resolution to the issue is to use SQLStament2 (the query is above 255 characters).

    Also, if you would like to acheive this using the GUI you could use the sort functions available as described here.

    Please let me know if you have any questions.

    Thanks,
    Avinash.
    Thursday, November 19, 2009 1:35 AM
    Moderator