run-time error 4198

P

Peter Wyss

Hello,

I have created a serial letter with the odbc-source (jiraissue table on
our server server01) with the following macro:

Option Explicit

Private Sub cmdCancel_Click()
Unload Me
End Sub

Private Sub cmdOK_Click()
ActiveDocument.MailMerge.DataSource.QueryString = _
"SELECT * FROM `jiraissue` WHERE ((`PROJECT` = '" _
& txtProject.Text & "'))"
End Sub

When this dot-template start, a form start up. In this form, the user
can type the Projectnumber. Then Word should list all Documents with
this Projectnumber. But when i click OK on my form an error occured:

Run-time error 4198: command failed

The problem occured in the
ActiveDocument.MailMerge.DataSource.QueryString Statement. What could be
the problem? Does anyone have a turtorial or something like that?

PS: I'm using Office xp (i don't know, if serial letter is the right
translation...serial letter means serienbrief in german;)

Thanks a lot,
Peter
 
P

Peter Wyss

Problem solved:

ActiveDocument.MailMerge.DataSource.QueryString = _
"SELECT * FROM [jiraissue] WHERE (([PROJECT] = '" & _
txtProject.Text & "'))" & ""

Peter
 

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