Peter, thank you for the reply. Some answers to 2
questions you asked:
1.Q>If you display the SQL using the SQL button in MS
Query, do you see the parameter placeholders?
No. If I go back through the Wizard and at last step I
select the "View data or edit query in Microsoft Query"
radio button and click "Finish", I get the "Too few
parameters. Expected 1." error. If I click the "OK"
button it takes me back to the last step of the wizard.
Then instead of clicking the "Finish" button, if I click
the "Cancel" button and then click on "Yes" to the "Do you
want to continue editing this query in Microsoft Query?"
dialog box, I once again get the "Too few parameters.
Expected 1." error. But this time, if I click OK, I am
taken to the Microsoft Query grid, where only my query is
the only table in the grid (this is the Access Parameter
Query"). Then, if click the "SQL" button to show my SQL,
there is no parameters placeholders, just a very simple
SQL statement (not even a WHERE clause). Sample below:
SELECT <field1>, <field2>, ...etc
FROM <AccessParameterQuery>
2.Q> ...as I can remember that doesn't really work either.
As I suggested before, if you can't use DDE I think the
only way you will be able to do this is to use code to get
the SQL query with the parameter placeholders, fill in the
parameter values yourself, then issue that SQL, e.g. using
OpenDataSource.
Where would I place this code you speak of? I know how to
use QueryDefs within VBA/Access to supply the Parameter
values of a Parameter Query, but how would I get the Word
Document to bind to this? Or, is this code I would place
within the Word Document?
I cannot believe that to accomplish what I want to is this
difficult and requires this many "Hoops to jump through"
to get what I need. I wonder why Microsoft has not
updated their "http://support.microsoft.com/default.aspx?
scid=kb;en-us;214183&Product=acc2000" document for Word
2002.
>-----Original Message-----
>If you display the SQL using the SQL button in MS Query, do you see the
[quoted text clipped - 61 lines]
>
>.
Peter Jamieson - 14 Sep 2004 12:15 GMT
We may be talking at cross-purposes here.
> I cannot believe that to accomplish what I want to is this
> difficult and requires this many "Hoops to jump through"
> to get what I need. I wonder why Microsoft has not
> updated their "http://support.microsoft.com/default.aspx?
> scid=kb;en-us;214183&Product=acc2000" document for Word
> 2002.
Well, that article essentially says "you have to use DDE", and in that
respect, nothing has changed in Word 2002 except the way you do that in the
user interface. You have to check Tools|Options|General|"Confirm conversions
at open", then go through the database selection process again and select
the DDE option when offered.Programmatically, you need to add the parameter
Subtype:=wdMergeSubTypeWord2000
in your OpenDataSource call.
I thought I'd said that already, but perhaps it was in answer to the very
similar query that popped up about the same time.
> I cannot believe that to accomplish what I want to is this
> difficult and requires this many "Hoops to jump through"
> to get what I need.
If you do not want to use DDE (e.g. because of the complication that it
needs to start Access etc.) then I'm afraid it probably is that difficult. I
wish it were not, but it's certainly the only way I can think of doing it.
> Where would I place this code you speak of? I know how to
> use QueryDefs within VBA/Access to supply the Parameter
> values of a Parameter Query, but how would I get the Word
> Document to bind to this? Or, is this code I would place
> within the Word Document?
You might do something like:
a. get the query text programatically using DAO or ADO
b. fill in the actual parameter values you need to use (i.e. create the
actual SQL query text you want to issue, not use the parameter-specification
facilities of DAO/ADO ). If you are getting parameters from the user you
need to be careful to avoid SQL injection hacks.
c. use OpenDataSource to open the Access database, providing the SQL you
constructed in SQLStatement and SQLStatment1 if the query is longer than 255
characters (but there may be an error in Word 2002 that limits the total
length to 255 or so anyway).
Yes, not something I would want to have to do.

Signature
Peter Jamieson
> Peter, thank you for the reply. Some answers to 2
> questions you asked:
[quoted text clipped - 132 lines]
> >
> >.