N
nate
essentially I have a mail merge that produces headings and parameters for a
DATABASE query, so for every mailmerge heading there is a new query that
produces a table under that mailmerge heading.
Problem is that I want to use me.path in order to fill the path to the
database in the query vs. hard coding it. Below are some scratchy comments
about what I have tried so far.
when you do an insert -> DATABASE and use a mailmerge field inside of the
text that you use for the DATABASE connection. I need to use the me.path in
that as well but don't know how to replace that text.
I know I can access that DATABASE text via:
ActiveDocument.Fields(2).Code
For example if I make a button and in the click event
put a msgbox(ActiveDocument.Fields(2).Code)
it will show me what is being used in the DATABASE query.
But when I try to fill a string var with the correct code and stick that
string into the ActiveDocument.Fields(2).Code object via:
ActiveDocument.Fields(2).Code = tempstr
it errors. maybe because I am running it inside the document.open() func.
if not here then where do I run it? I can't do it manually via buttons etc.
this is all suppose to be an automated process.
DATABASE query, so for every mailmerge heading there is a new query that
produces a table under that mailmerge heading.
Problem is that I want to use me.path in order to fill the path to the
database in the query vs. hard coding it. Below are some scratchy comments
about what I have tried so far.
when you do an insert -> DATABASE and use a mailmerge field inside of the
text that you use for the DATABASE connection. I need to use the me.path in
that as well but don't know how to replace that text.
I know I can access that DATABASE text via:
ActiveDocument.Fields(2).Code
For example if I make a button and in the click event
put a msgbox(ActiveDocument.Fields(2).Code)
it will show me what is being used in the DATABASE query.
But when I try to fill a string var with the correct code and stick that
string into the ActiveDocument.Fields(2).Code object via:
ActiveDocument.Fields(2).Code = tempstr
it errors. maybe because I am running it inside the document.open() func.
if not here then where do I run it? I can't do it manually via buttons etc.
this is all suppose to be an automated process.