![]() |
|
![]() |
|
Thread Tools | Display Modes |
|
#1
|
||||
|
||||
![]()
Why not simply have the mailmerge main document connect directly to the database and apply whatever filtering you require within the mailmerge main document itself?
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#2
|
|||
|
|||
![]() Quote:
I did try this initially. The issue I ran into, was the sql statement was very long and complex. Using the OpenDataSource function, the SQLStatement and SQLStatement1 parameters seemed to not be large enough for this query. Working with Access regularly, it was easy to establish a connection and recordset, and throw the data I need into a file. It doesn't change very often, so this disconnected data works very well. |
#3
|
||||
|
||||
![]()
SQLStatement is suitable for query strings up to 255 characters. Where the query string is longer than 255 characters, you'd use SQLStatement1 for the remainder; there is no specified character limit for SQLStatement1.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#4
|
|||
|
|||
![]() Quote:
Are you sure SQLStatement1 accepts a longer string? Code:
strSQL1 = Left(strSQL, 255) strSQL2 = Right(strSQL, Len(strSQL) - 255) If I remove a few spaces or one of the WHERE criteria from the statement, it executes ok... ![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
Kevin Beach | Word | 3 | 11-26-2016 06:14 PM |
![]() |
samhdc | Word | 7 | 01-26-2015 04:21 PM |
![]() |
Carlos06x | Word | 1 | 10-12-2011 10:39 AM |
Programmatically get File Path for currently opened WORD document | franferns | Word | 1 | 11-26-2009 12:36 PM |
![]() |
Ziggy1 | Word VBA | 1 | 09-29-2006 07:55 PM |