Merging data from Access Query

T

Technojunkie

Hello:

I have this document that is supposed to populate certain fields in a
word document from an access database. I'll try to explain this the best I
can.
I've never dealt with populating fields in word only mail merging, so I
don't know where to begin inside word.

The process starts in an access database. I don't think there is
anything wrong with the query or the form, rather inside word the way that it
tries to merge the access data from the query. I can run the query inside
access and it pulls the information back just fine. Here's what happens on
the word side.
I open the access database and have a form called letterpopup. Inside
the form is a merge button to merge fields into a word document.
If the form is CLOSED I get prompted for the parameter value. If the form
is OPEN, everything works fine.

When I try to merge, I get the following messages:

"Opening this document will run the following SQL command. Select * from
[ClaimsQuery]. Data from the database will be placed in the document, do you
want to continue? Y/N ?" If I click yes, I'm prompted to enter the parameter
value to continue, If the form is CLOSED. If the form is OPEN, everything
works fine.

I've checked the query and the paramater that is supposed to pass to
the word document isn't checked, so it should pass it without getting
prompted for it. Also in the Criteria section of the query is the proper
information.

How do I check inside of the word document to see how it passes or processes
the and merge the information?

Any help or ideas would be greatly appreciated and welcomed.
 
P

Peter Jamieson

"Opening this document will run the following SQL command. Select * from
[ClaimsQuery]. Data from the database will be placed in the document, do
you
want to continue? Y/N ?"

To get rid of the above message, see the following article:

http://support.microsoft.com/kb/825765/en-us

If the query references the Form (which it can do in Access), then when Word
tries to execute the query, it will fail becuase the form isn't loaded. (At
least, I think that is what is happening in this case. So either you need to
ensure that your Mailmerge /only/ executes when the form is open, or you
need to write a query that will return the correct results whether or not
the form is open (or perhaps use another approach such as setting up a table
to contain the results you want to merge.

Peter Jamieson
Technojunkie said:
Hello:

I have this document that is supposed to populate certain fields in a
word document from an access database. I'll try to explain this the best
I
can.
I've never dealt with populating fields in word only mail merging, so I
don't know where to begin inside word.

The process starts in an access database. I don't think there is
anything wrong with the query or the form, rather inside word the way that
it
tries to merge the access data from the query. I can run the query inside
access and it pulls the information back just fine. Here's what happens
on
the word side.
I open the access database and have a form called letterpopup. Inside
the form is a merge button to merge fields into a word document.
If the form is CLOSED I get prompted for the parameter value. If the form
is OPEN, everything works fine.

When I try to merge, I get the following messages:

"Opening this document will run the following SQL command. Select * from
[ClaimsQuery]. Data from the database will be placed in the document, do
you
want to continue? Y/N ?" If I click yes, I'm prompted to enter the
parameter
value to continue, If the form is CLOSED. If the form is OPEN, everything
works fine.

I've checked the query and the paramater that is supposed to pass to
the word document isn't checked, so it should pass it without getting
prompted for it. Also in the Criteria section of the query is the proper
information.

How do I check inside of the word document to see how it passes or
processes
the and merge the information?

Any help or ideas would be greatly appreciated and welcomed.
 
T

Technojunkie

Hi and thanks for the information.

The form is being loaded in the background. It's just when the merge tries
to merge the fields from the access database query, it's prompting for the
information that the query needs to pull back the record and merge it. If I
run the access form it will open up the form in the background which still
produces the error. My handicap is not knowing how inside of word, you can
tell it to get the information from the access query. I think this is where
the problem lies.

Peter Jamieson said:
"Opening this document will run the following SQL command. Select * from
[ClaimsQuery]. Data from the database will be placed in the document, do
you
want to continue? Y/N ?"

To get rid of the above message, see the following article:

http://support.microsoft.com/kb/825765/en-us

If the query references the Form (which it can do in Access), then when Word
tries to execute the query, it will fail becuase the form isn't loaded. (At
least, I think that is what is happening in this case. So either you need to
ensure that your Mailmerge /only/ executes when the form is open, or you
need to write a query that will return the correct results whether or not
the form is open (or perhaps use another approach such as setting up a table
to contain the results you want to merge.

Peter Jamieson
Technojunkie said:
Hello:

I have this document that is supposed to populate certain fields in a
word document from an access database. I'll try to explain this the best
I
can.
I've never dealt with populating fields in word only mail merging, so I
don't know where to begin inside word.

The process starts in an access database. I don't think there is
anything wrong with the query or the form, rather inside word the way that
it
tries to merge the access data from the query. I can run the query inside
access and it pulls the information back just fine. Here's what happens
on
the word side.
I open the access database and have a form called letterpopup. Inside
the form is a merge button to merge fields into a word document.
If the form is CLOSED I get prompted for the parameter value. If the form
is OPEN, everything works fine.

When I try to merge, I get the following messages:

"Opening this document will run the following SQL command. Select * from
[ClaimsQuery]. Data from the database will be placed in the document, do
you
want to continue? Y/N ?" If I click yes, I'm prompted to enter the
parameter
value to continue, If the form is CLOSED. If the form is OPEN, everything
works fine.

I've checked the query and the paramater that is supposed to pass to
the word document isn't checked, so it should pass it without getting
prompted for it. Also in the Criteria section of the query is the proper
information.

How do I check inside of the word document to see how it passes or
processes
the and merge the information?

Any help or ideas would be greatly appreciated and welcomed.
 
P

Peter Jamieson

What is the Query's SQL?

- you should be able to dig this out from Access somewhere, but you may be
able to see what /Word/ thinks the SQL is by going into the Word VBA
editor, finding the "immediate" panel, and issuing

print ActiveDocument.MailMerge.DataSource.QueryString

Peter Jamieson
Technojunkie said:
Hi and thanks for the information.

The form is being loaded in the background. It's just when the merge
tries
to merge the fields from the access database query, it's prompting for the
information that the query needs to pull back the record and merge it. If
I
run the access form it will open up the form in the background which still
produces the error. My handicap is not knowing how inside of word, you
can
tell it to get the information from the access query. I think this is
where
the problem lies.

Peter Jamieson said:
"Opening this document will run the following SQL command. Select *
from
[ClaimsQuery]. Data from the database will be placed in the document,
do
you
want to continue? Y/N ?"

To get rid of the above message, see the following article:

http://support.microsoft.com/kb/825765/en-us

If the query references the Form (which it can do in Access), then when
Word
tries to execute the query, it will fail becuase the form isn't loaded.
(At
least, I think that is what is happening in this case. So either you need
to
ensure that your Mailmerge /only/ executes when the form is open, or you
need to write a query that will return the correct results whether or not
the form is open (or perhaps use another approach such as setting up a
table
to contain the results you want to merge.

Peter Jamieson
Technojunkie said:
Hello:

I have this document that is supposed to populate certain fields in
a
word document from an access database. I'll try to explain this the
best
I
can.
I've never dealt with populating fields in word only mail merging, so I
don't know where to begin inside word.

The process starts in an access database. I don't think there is
anything wrong with the query or the form, rather inside word the way
that
it
tries to merge the access data from the query. I can run the query
inside
access and it pulls the information back just fine. Here's what
happens
on
the word side.
I open the access database and have a form called letterpopup.
Inside
the form is a merge button to merge fields into a word document.
If the form is CLOSED I get prompted for the parameter value. If the
form
is OPEN, everything works fine.

When I try to merge, I get the following messages:

"Opening this document will run the following SQL command. Select *
from
[ClaimsQuery]. Data from the database will be placed in the document,
do
you
want to continue? Y/N ?" If I click yes, I'm prompted to enter the
parameter
value to continue, If the form is CLOSED. If the form is OPEN,
everything
works fine.

I've checked the query and the paramater that is supposed to pass
to
the word document isn't checked, so it should pass it without getting
prompted for it. Also in the Criteria section of the query is the
proper
information.

How do I check inside of the word document to see how it passes or
processes
the and merge the information?

Any help or ideas would be greatly appreciated and welcomed.
 
T

Technojunkie

OK, I think I have the culpret involved. When I click to have the data
merged into a word document, I get the SQL message about merging data into
word. When I click yes to do this, something strange happens. When I press
the merge button the form is already open in the background and the access
query criteria is to pull ALL information from one table based on a certain
field criteria in the form that is open in the background. After the process
takes place, word wants to open multiple copies of access, instead of
utilizing the form and the database that are already opened up.

I have re-established the links from the query to the table fields, checked
the SQL information inside of word to make sure everything is right for the
query and basically gone through with a comb trying to find out the issue.

My question is - Why is word opening multiple instances of access when the
query is initiated and how can this be checked and resolved?

Peter Jamieson said:
What is the Query's SQL?

- you should be able to dig this out from Access somewhere, but you may be
able to see what /Word/ thinks the SQL is by going into the Word VBA
editor, finding the "immediate" panel, and issuing

print ActiveDocument.MailMerge.DataSource.QueryString

Peter Jamieson
Technojunkie said:
Hi and thanks for the information.

The form is being loaded in the background. It's just when the merge
tries
to merge the fields from the access database query, it's prompting for the
information that the query needs to pull back the record and merge it. If
I
run the access form it will open up the form in the background which still
produces the error. My handicap is not knowing how inside of word, you
can
tell it to get the information from the access query. I think this is
where
the problem lies.

Peter Jamieson said:
"Opening this document will run the following SQL command. Select *
from
[ClaimsQuery]. Data from the database will be placed in the document,
do
you
want to continue? Y/N ?"

To get rid of the above message, see the following article:

http://support.microsoft.com/kb/825765/en-us

If the query references the Form (which it can do in Access), then when
Word
tries to execute the query, it will fail becuase the form isn't loaded.
(At
least, I think that is what is happening in this case. So either you need
to
ensure that your Mailmerge /only/ executes when the form is open, or you
need to write a query that will return the correct results whether or not
the form is open (or perhaps use another approach such as setting up a
table
to contain the results you want to merge.

Peter Jamieson
Hello:

I have this document that is supposed to populate certain fields in
a
word document from an access database. I'll try to explain this the
best
I
can.
I've never dealt with populating fields in word only mail merging, so I
don't know where to begin inside word.

The process starts in an access database. I don't think there is
anything wrong with the query or the form, rather inside word the way
that
it
tries to merge the access data from the query. I can run the query
inside
access and it pulls the information back just fine. Here's what
happens
on
the word side.
I open the access database and have a form called letterpopup.
Inside
the form is a merge button to merge fields into a word document.
If the form is CLOSED I get prompted for the parameter value. If the
form
is OPEN, everything works fine.

When I try to merge, I get the following messages:

"Opening this document will run the following SQL command. Select *
from
[ClaimsQuery]. Data from the database will be placed in the document,
do
you
want to continue? Y/N ?" If I click yes, I'm prompted to enter the
parameter
value to continue, If the form is CLOSED. If the form is OPEN,
everything
works fine.

I've checked the query and the paramater that is supposed to pass
to
the word document isn't checked, so it should pass it without getting
prompted for it. Also in the Criteria section of the query is the
proper
information.

How do I check inside of the word document to see how it passes or
processes
the and merge the information?

Any help or ideas would be greatly appreciated and welcomed.
 
P

Peter Jamieson

Sorry, missed this one.
My question is - Why is word opening multiple instances of access when the
query is initiated and how can this be checked and resolved?

I don't know for sure and so far I haven't tried to replicate your findings,
but the first place I would look is the following KB article:

http://support.microsoft.com/kb/224697/en-us

Peter Jamieson


Technojunkie said:
OK, I think I have the culpret involved. When I click to have the data
merged into a word document, I get the SQL message about merging data into
word. When I click yes to do this, something strange happens. When I
press
the merge button the form is already open in the background and the access
query criteria is to pull ALL information from one table based on a
certain
field criteria in the form that is open in the background. After the
process
takes place, word wants to open multiple copies of access, instead of
utilizing the form and the database that are already opened up.

I have re-established the links from the query to the table fields,
checked
the SQL information inside of word to make sure everything is right for
the
query and basically gone through with a comb trying to find out the issue.

My question is - Why is word opening multiple instances of access when the
query is initiated and how can this be checked and resolved?

Peter Jamieson said:
What is the Query's SQL?

- you should be able to dig this out from Access somewhere, but you may
be
able to see what /Word/ thinks the SQL is by going into the Word VBA
editor, finding the "immediate" panel, and issuing

print ActiveDocument.MailMerge.DataSource.QueryString

Peter Jamieson
Technojunkie said:
Hi and thanks for the information.

The form is being loaded in the background. It's just when the merge
tries
to merge the fields from the access database query, it's prompting for
the
information that the query needs to pull back the record and merge it.
If
I
run the access form it will open up the form in the background which
still
produces the error. My handicap is not knowing how inside of word, you
can
tell it to get the information from the access query. I think this is
where
the problem lies.

:

"Opening this document will run the following SQL command. Select *
from
[ClaimsQuery]. Data from the database will be placed in the
document,
do
you
want to continue? Y/N ?"

To get rid of the above message, see the following article:

http://support.microsoft.com/kb/825765/en-us

If the query references the Form (which it can do in Access), then
when
Word
tries to execute the query, it will fail becuase the form isn't
loaded.
(At
least, I think that is what is happening in this case. So either you
need
to
ensure that your Mailmerge /only/ executes when the form is open, or
you
need to write a query that will return the correct results whether or
not
the form is open (or perhaps use another approach such as setting up a
table
to contain the results you want to merge.

Peter Jamieson
message
Hello:

I have this document that is supposed to populate certain fields
in
a
word document from an access database. I'll try to explain this the
best
I
can.
I've never dealt with populating fields in word only mail merging,
so I
don't know where to begin inside word.

The process starts in an access database. I don't think there
is
anything wrong with the query or the form, rather inside word the
way
that
it
tries to merge the access data from the query. I can run the query
inside
access and it pulls the information back just fine. Here's what
happens
on
the word side.
I open the access database and have a form called letterpopup.
Inside
the form is a merge button to merge fields into a word document.
If the form is CLOSED I get prompted for the parameter value. If the
form
is OPEN, everything works fine.

When I try to merge, I get the following messages:

"Opening this document will run the following SQL command. Select *
from
[ClaimsQuery]. Data from the database will be placed in the
document,
do
you
want to continue? Y/N ?" If I click yes, I'm prompted to enter the
parameter
value to continue, If the form is CLOSED. If the form is OPEN,
everything
works fine.

I've checked the query and the paramater that is supposed to
pass
to
the word document isn't checked, so it should pass it without
getting
prompted for it. Also in the Criteria section of the query is the
proper
information.

How do I check inside of the word document to see how it passes or
processes
the and merge the information?

Any help or ideas would be greatly appreciated and welcomed.
 

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