Pass Access criteria direct to a Word document

J

JethroUK©

I have std mailmerge letter based on std access query (no criteria just the
fields) so i need to pass the criteria (sql 'Where' statement) dynamically
direct to the document in VB on it opening

Does mail merge doc support sql where statement? - Is this possible?
 
G

Guest

In the query design view grid add a column --
Criteria: [YourCriteriaPrompt]

Copy the criteria from the criteria row of the query so there will be no
errors and paste it after the colon in the field row. The criteria will
then be in the query output and available for use in Word Mailmerge.
 
J

JethroUK©

the merge document has to be based on an access form filter (std SQL Where
statement) - the query criteria is simple for Access:

[forms]![myform]![mycriteria]

yet apparently too complex for MS Word to use as a data source (doesn't even
show up as a possible data source unless i remove the criteria)

hence there's no copy/paste - hence the where statement (filter) has to be
done dynamically (programmatically)



KARL DEWEY said:
In the query design view grid add a column --
Criteria: [YourCriteriaPrompt]

Copy the criteria from the criteria row of the query so there will be no
errors and paste it after the colon in the field row. The criteria will
then be in the query output and available for use in Word Mailmerge.

JethroUK© said:
I have std mailmerge letter based on std access query (no criteria just the
fields) so i need to pass the criteria (sql 'Where' statement) dynamically
direct to the document in VB on it opening

Does mail merge doc support sql where statement? - Is this possible?
 
D

Doug Robbins - Word MVP

From the Tools menu, selection Options and then on the General tab, check
the box for "Confirm conversions at open". Then when you attach the
datasource to the maindocument, you will be asked for the connection method
to be used. Try the DDE connection.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

JethroUK© said:
the merge document has to be based on an access form filter (std SQL Where
statement) - the query criteria is simple for Access:

[forms]![myform]![mycriteria]

yet apparently too complex for MS Word to use as a data source (doesn't
even
show up as a possible data source unless i remove the criteria)

hence there's no copy/paste - hence the where statement (filter) has to be
done dynamically (programmatically)



KARL DEWEY said:
In the query design view grid add a column --
Criteria: [YourCriteriaPrompt]

Copy the criteria from the criteria row of the query so there will be no
errors and paste it after the colon in the field row. The criteria will
then be in the query output and available for use in Word Mailmerge.

JethroUK© said:
I have std mailmerge letter based on std access query (no criteria just the
fields) so i need to pass the criteria (sql 'Where' statement) dynamically
direct to the document in VB on it opening

Does mail merge doc support sql where statement? - Is this possible?
 

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