Dear Cindy and Peter
Thank you for your reply.
Actually I am making an Access Form this is for printing
records to be specified in textbox "txtFrom" and "txtTo".
The statements are as following.
MergeWord.Visible = True
Set MergeDoc = MergeWord.Documents.Open(FileName:="f:\TI
Record K.doc")
Set myMerge = ActiveDocument.MailMerge
Set db = OpenDatabase("f:\UNE_K 2000.mdb")
Set rst = db.OpenRecordset("TI_UME Query")strMerge
= "SELECT * FROM 'rst' WHERE [TI Ref] >= " & Me!txtFrom
& " AND [TI Ref] <= " & Me!txtTo
myMerge.DataSource.QueryString = strMerge
.
.
.
The program just halted at the last line with error
massage: "Run-time error '4198', Command failed." shown.
According to the Office assistance it is allow to set the
arrange of MailMerge DataSource with QueryString, but I
can not figure the problem.
Thank you for your advice in advance.
-----Original Message-----
Hi Warren,
I'm going to set query to MailMerge like this, but it does
not work. What is the problem?
strMerge = "SELECT * FROM 'rst' WHERE [TI Ref] >= " & Me!
txtFrom & " AND [TI Ref] <= " & Me!txtTo
ActiveDocument.MailMerge.DataSource.QueryString = strMerge
What, more exactly, does Me! represent, here?
And if you're getting an error message, what is it? "does not
work" is really rather vague...
Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jan
24 2003)
http://www.mvps.org/word
This reply is posted in the Newsgroup; please post any follow
question or reply in the newsgroup and not by e-mail
.