Change SQL or Sort?

B

Bert

I have a mailmerge document in Word 2003. The datasource for it is an excel
spreadsheet. When I open the document, it displays an SQL query in a
message box. Right now, the mailmerge document only displays certain data.
(One of the spreadsheet columns is Block, and in the query there is a
statement, "WHERE 'Block' = 'C'", so only the rows with "C" in Block are
being inserted into the mailmerge doc.) Is there a way to access the SQL
query command and change that?
Alternatively, the data could simply be sorted by Block - which might
actually be better.
Thanks.
Bert
 
P

Peter Jamieson

1. Enable the mailmerge toolbar (View->Toolbars)
2. Click the 3rd icon (mail merge recipients)
3. Either
a. select the drop-down arrow to the left of "block" in the column
header, and select All or
b. click the drop-down arrow to the left of any of the column headers,
click Advanced... and you should see any existing query filters/sort
options.

(If you want to save the change, save the document)

Alternatively, you can fix the SQL directly but only in VBA.


Peter Jamieson

http://tips.pjmsn.me.uk
 
B

Bert

Thanks, Peter! Just what I needed!
Bert

Peter Jamieson said:
1. Enable the mailmerge toolbar (View->Toolbars)
2. Click the 3rd icon (mail merge recipients)
3. Either
a. select the drop-down arrow to the left of "block" in the column
header, and select All or
b. click the drop-down arrow to the left of any of the column headers,
click Advanced... and you should see any existing query filters/sort
options.

(If you want to save the change, save the document)

Alternatively, you can fix the SQL directly but only in VBA.


Peter Jamieson

http://tips.pjmsn.me.uk
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top