Word + Access2000. Merge document opening new instance of DB

D

Dave Twohig

i am using word to take in fields from a query in an
access database. the users of the database are not
familiar with the design of reports in access and
therefore want to have their reports in word format so it
will be easier for them to be altered. the query takes
data from three tables. two of which have criteria based
on user input in a form. i am using a command button on
the same form to open the word document as a report. it's
working fine in that all the information is transferring
correctly and the format is okay.
the problem is that the merge document will only pull the
data from the query if another access database has been
opened (and is still open) before the database that i am
linking. otherwise the word document tries to open another
instance of the database. the document will ask for fields
from the query (these are the same fields that are based
on the user input) rather than read them from the query in
the original database.
i hope the problem is clear. please ask if it's not.
anyone got any ideas?

thanks,
Dave T
 
D

Dave Twohig

Hi Cindy,

I've tried using an ODBC connection for this already but i
keep getting an error that says "Word was unable to open
the data source." I had assumed that this was because i
was trying to connect a query over a ODBC Connection so i
stuck with DDE. Is there a way to make the ODBC Connection
to the query work? Have i left out a step in creatind the
ODBC Connection?

Thanks,

Dave
 
D

Dave Twohig

Hi Cindy,

Okay good point about not being able to look over my
shoulder. :)

I think I need to leave the parameters as they are as I
want some user input from the form to be merged directly
with word. The user will click on a button on the form
which will open the document with word, so the interface
should already be open. It just seems a little frustrating
that word then tries to open a new instance of the
database rather than using the one where the button was
clicked. Surely there must be a way to do this using VBA
code (I simply haven't found it yet).
As I mentioned previously though, it works when another
database is open first. Maybe I could convince the users
to get used to opening a blank database first, even if
this isn't the most ideal solution.

Thanks,

Dave
 
C

Cindy Meister -WordMVP-

Hi Dave,
It just seems a little frustrating
that word then tries to open a new instance of the
database rather than using the one where the button was
clicked. Surely there must be a way to do this using VBA
code (I simply haven't found it yet).
It's a known behavior, and I've never heard anyone find
another workaround than to use an ODBC connection. I really
don't see why it would be a problem to have your code put
the form data into a QueryDef (SQL), rather than having the
query pull it directly from the form <shrug>

But in that case, why not have your form code start up the
other instance of Access?
As I mentioned previously though, it works when another
database is open first. Maybe I could convince the users
to get used to opening a blank database first, even if
this isn't the most ideal solution.

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
:)
 
D

Dave Twohig

Hi Cindy,

I wouldn't be 100% sure how to make the code put the form
data into a QueryDef (SQL) and I would be less sure how to
provide support when it's done.

I can't get the code to open the other instance of Access
as it needs to be open before I open the database.

Thanks for your help,
Dave
 
C

Cindy Meister -WordMVP-

Hi Dave,
I wouldn't be 100% sure how to make the code put the form
data into a QueryDef (SQL) and I would be less sure how to
provide support when it's done.
Ask in an Access group, if you really want to follow up on
this. It's not hard :)

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 :)
 

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