Parameterized Queries in Mail Merge v.2000 vs. 2003

T

Todd C

In Word 2000, you could design an Access query with an input parameter using
the syntax
.[field] = [ask me here]. If you ysed this type of query as
a Word Merge datasource, you would be presented with a dialog box to supply
the [ask me here] value before Word/Access retreived the data. That worked
great!

What happened in Word 2003? The data source options do not allow you to
select 'parameterized' queries, only regular queries, then you have to go
through and manually define the filter, but AFTER Word has pulled ALL the
records. AND, you have to use the ADVANCED feature of filtering, etc. It is a
whole lot harder if you are going to use a filter on the same field EVERY
TIME.

Is there a way to use a parameterized query from Access, ADP/SQL as a source
for a Word Merge in version 2003?

I agree with a previous post that the old way was better!

Todd
 
B

Beth Melton

Then continue using the old way. :)

They changed the default connection method to OLE DB but you can still
use the DDE method, which was used by default in Office 2000, to
connect.to your Access database.

In Word go to Tools/Options/General and turn on "Confirm conversions
at open". Then select your Excel data source again and when prompted
select the DDE method.

Please post all follow-up questions to the newsgroup. Requests for
assistance by email can not be acknowledged.

~~~~~~~~~~~~~~~
Beth Melton
Microsoft Office MVP

Word FAQ: http://mvps.org/word
TechTrax eZine: http://mousetrax.com/techtrax/
MVP FAQ site: http://mvps.org/
 
T

Todd C

Beth,
Thanks for the reply.

I get an error when I try to connect under the following conditions:
*Using either DDE or ODBC as the connection method
and
*The query is defined with input parameters.


Error message is: "Word could not establish a DDE connection to Microsoft
Access to complete the current task." when I try with DDE
or
"Word was unable to open the data source" if I use ODBC.

I was able to create a 'clean' db in Access and a 'clean' Word Merge doc,
and by connecting via DDE it showed the behavior I was hoping for, in that it
popped up the input parameter for my query. But it still reports the error
when connecting to the original Db. I tried Compact and Repair, converting it
back to Access version 2000. Nothing seems to work.

Any ideas?

Thanks for your help.

As a side note, the ultimate source for the data is a SQL Server 2000
database, hosted on a Windows Server 2003 machine. I don't think that should
matter.
 
B

Beth Melton

T

Todd C

Thanks. I looked at the KB article, but that was not the problem. There must
have been something wrong with the Access file because after creating a new
one and importing and linking all the objects it works pretty good.

However, there is one nuisance that I can't figure out:

I am creating Word Templates with merge recordsets (hooked to the Access Db
via the DDE link you suggested) so that my users can either edit the queries
proir to openning the Template, or use a parameterized query to filter the
recordset at the time Word connects to the data.

Now, here's the problem: When I open a template to test it, Word creates a
new document based on the template, then executes the query, then displays
the document. In the Mail Merge task pane, it keeps the Mail Merge source
recordset so that I can click on "Edit recipient list..." if I want to skinny
down the records. That part is fine. BUT, when my test user takes those same
steps, the connection to the recordset gets lost for some of the templates. I
know Word is reading the query correctly because it pops up the Input
Parameter box for queries that have them designed in, but then in Word, he
has to click the "Browse..." link in the Mail Merge task pane and navigate to
the Access Database, then select the query.

It never looses the connection info like that on my machine, only on his,
and not on all the templates.

Any ideas? Thanks in advance.
 

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