Syntax for strDir and strSQL

G

Guest

Can anybody help untangle this syntax, please?
I can specify either the strSQL or the strDir, but want to do both

Private Sub cmdMergeAllLw_Click()
strSQL = "Select * from qryNotifConcat WHERE CaseID =" & [ContactID]
strDir = "Lawyer\"

Me.Refresh
MergeAllWord ("Select * from qryNotifConcat WHERE CaseID =" &
[ContactID])

'Note that you could use a condtion in the above sql
End Sub

This is from the Kallal word merge which works great with this code or with
the following:
MergeAllWord "Lawyer"

I want each procedure I call to use its own directory of merge documents.
There is a MergeSingleWord and a MergeAllWord.

How do I specify the directory "Word\Lawyer\" for the word doc to come from?
When I use MergeAllWord ("Select * from qryNotifConcat WHERE CaseID =" &
[ContactID],"Word\Lawyer\") the error msg is "expected =". If I put in
strDir="Word\Lawyer\" I get "expected expression" or "end of statement".

Thanks in advance - this is whacked.
 
A

Albert D. Kallal

I want each procedure I call to use its own directory of merge documents.
There is a MergeSingleWord and a MergeAllWord.

How do I specify the directory "Word\Lawyer\" for the word doc to come
from?
When I use MergeAllWord ("Select * from qryNotifConcat WHERE CaseID =" &
[ContactID],"Word\Lawyer\") the error msg is "expected =". If I put in
strDir="Word\Lawyer\" I get "expected expression" or "end of statement".

Use:

MergeAllWord ("Select * from qryNotifConcat
WHERE CaseID = " & [ContactID]), "Lawyer\"

(above on one line)

Your brackets need to surround the sql, or *expression*. So, rid of them -
you ONLY need
brackets to surround a expression, but not for a sub call.

the above will create a dir called "lawyer" in the same directory as the mdb
file (where it runs). So, the path name of the dir is RELATIVE to that of
the current dir.

If don't want a whole bunch of "dirs" to proliferate, the you could place
them all in side of the word dir (in fact, looking at your example, this
*SEEMS* what you actually desired.). So, try:

MergeAllWord ("Select * from qryNotifConcat
WHERE CaseID = " & [ContactID]), "word\Lawyer\"

Note, for brackets, you could use:

MergeAllWord ("Select * from qryNotifConcat
WHERE CaseID = " & [ContactID]), ("word\Lawyer\")

As mentioned, since this is a function call, (but not returning values),
then brackets are NOT needed. eg:

MergeAllWord "Select * from qryNotifConcat
WHERE CaseID = " & [ContactID], "word\Lawyer\"

In fact, for the sake of calariy, I would leave out the brekctes. There are
some addtonal syntax examples that show the use of the "directory" option
here:

http://www.members.shaw.ca/AlbertKallal/wordmerge/page2.html

Note in above how you can set the "directory" location to be absolute, or
relative to where the mdb/mde is running...
 
G

Guest

Ecstatic doesn't begin to cover it....

thank you very much for the awesome help!!! and amazing word merge...
--
Lungta


Albert D. Kallal said:
I want each procedure I call to use its own directory of merge documents.
There is a MergeSingleWord and a MergeAllWord.

How do I specify the directory "Word\Lawyer\" for the word doc to come
from?
When I use MergeAllWord ("Select * from qryNotifConcat WHERE CaseID =" &
[ContactID],"Word\Lawyer\") the error msg is "expected =". If I put in
strDir="Word\Lawyer\" I get "expected expression" or "end of statement".

Use:

MergeAllWord ("Select * from qryNotifConcat
WHERE CaseID = " & [ContactID]), "Lawyer\"

(above on one line)

Your brackets need to surround the sql, or *expression*. So, rid of them -
you ONLY need
brackets to surround a expression, but not for a sub call.

the above will create a dir called "lawyer" in the same directory as the mdb
file (where it runs). So, the path name of the dir is RELATIVE to that of
the current dir.

If don't want a whole bunch of "dirs" to proliferate, the you could place
them all in side of the word dir (in fact, looking at your example, this
*SEEMS* what you actually desired.). So, try:

MergeAllWord ("Select * from qryNotifConcat
WHERE CaseID = " & [ContactID]), "word\Lawyer\"

Note, for brackets, you could use:

MergeAllWord ("Select * from qryNotifConcat
WHERE CaseID = " & [ContactID]), ("word\Lawyer\")

As mentioned, since this is a function call, (but not returning values),
then brackets are NOT needed. eg:

MergeAllWord "Select * from qryNotifConcat
WHERE CaseID = " & [ContactID], "word\Lawyer\"

In fact, for the sake of calariy, I would leave out the brekctes. There are
some addtonal syntax examples that show the use of the "directory" option
here:

http://www.members.shaw.ca/AlbertKallal/wordmerge/page2.html

Note in above how you can set the "directory" location to be absolute, or
relative to where the mdb/mde is running...
 

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