By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,495 Members | 1,002 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.

How do I merge a Access 2007 Parameter Query into Word 2007 Labels?

P: 36
I am trying to modify some code to create a mail merged label document within Word 2007, using a Access 2007 Parameter Field. My issue comes about when I cannot see the Parameter Query within the selecting list in Word. I would rather not have 40 queries for each year we are pulling, so I want to use the parameter query to simplify things.
I have thought using a Temp. Table and pulling from there - but have no clue as to how to go about that one either. I am still researching that option. I would rather get the Parameter Query to be recognized in Word as it seems to be easier (or so I thought). Thank you for any help anyone may be able to offer. AND - if I happened to miss the answer to this in a past post - I tried to go through many of the past questions.
Jan 25 '10 #1
Share this Question
Share on Google+
2 Replies


nico5038
Expert 2.5K+
P: 3,072
I guess the parameter is the Year.
In a case like that you could create a tblParameter holding the field Year and place by code the needed Year(s) as rows in the table. Now JOIN the Year field from the original table with this table and I guess the query will be visible in Word.

The needed code for the table filling behind a form with the YearValue field is:
Expand|Select|Wrap|Line Numbers
  1. currentdb.execute ("delete * from tblParameter" )
  2. currentdb.execute ("INSERT INTO tblParameter (YearValue) VALUES (" & Me.YearValue & ")")
  3.  
Don't use "Year" as the fieldname as that's also a function !

Nic;o)
Jan 25 '10 #2

P: 36
Have this resolved...Thank you for your reply! I appreciate it...
Feb 15 '10 #3

Post your reply

Sign in to post your reply or Sign up for a free account.