By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,495 Members | 1,158 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,495 IT Pros & Developers. It's quick & easy.

Query and Merge

P: n/a
We have a query which is used as a mail merge source in Word. No
problem. However we made it a parameter query and when trying to
establish the link between the query and the word document in the Data
Source window this query did not appear in the list of Access tables.
Deleted the parameter and reverted to Select query and there it is in
the Data Source window.

Can any body explain this please and also comment on whether a
parameter Query can be used in mail merge in Word

Jun 4 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
I think your explanation is about right....

A possible solution is to use my word merge sample.

my "super easy word merge" can be found here:
http://www.members.shaw.ca/AlbertKal.../msaccess.html

the above sample also has the same problem, but you can easily ask for the
parameter in code.

eg:

dim strSql as string

strSql = "Select * from tblCustomers where city = 'Edmonton'"

MergeAllWord strSql

The above sends all names from the tblCustomers from my city. To make a
prompt. you could go

dim strSql as string
dim strCity as string

strSql = "Select * from tblCustomers"

strcity = inputbox("what city")

if strCity <"" then
strSql = strSql & " where city = '" & strity & "'"
end if

MergeAllWord strSql

So, you can use my example to add parameters, but you have to write some
code.
--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pl*****************@msn.com
Jun 4 '07 #2

P: n/a
I haven't been able to do that. What I do is, instead of using a parameter
query, either: a) write the restricting data (such as list of primary keys
or whatever) to a temporary table, and join that table to the other table in
the query with an inner join; or b) write all the data for the merge to a
temporary table and just base the merge on that temporary table's data.
"zazu" <mi***********@gmail.comwrote in message
news:11**********************@i38g2000prf.googlegr oups.com...
We have a query which is used as a mail merge source in Word. No
problem. However we made it a parameter query and when trying to
establish the link between the query and the word document in the Data
Source window this query did not appear in the list of Access tables.
Deleted the parameter and reverted to Select query and there it is in
the Data Source window.

Can any body explain this please and also comment on whether a
parameter Query can be used in mail merge in Word

Jun 4 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.