Importing MS Access data into MS Word

Importing MS Access data into MS Word

am 29.11.2007 11:59:56 von H

In the thread "combining multiple address fields into 1 address field",
Stuart (?) helped solve that problem.

I then tried to set up a mail merge in Word to check how I could use and
merge the data.

I found the database tool bar and opened the appropriate database - but...
I could not find a way to open a particular table or query in order to
insert the fields from the query into Word.

The procedure I followed was this:

- open a blank word .doc
- from the database tool bar selected "insert database"
- a window opened, headed 'Database' and divided into 3 section:
at the top a section titled "data source",
a middle section titled "data options",
a bottom section titled "insert the data into the document"

- "under "data source" I clicked "get data"
- a window headed 'Select data source' opened

- I navigated to the relevant database (mobmem07.mdb) and selected it.
- this added the database location to the "data source" part of the
'database' window

- I then looked at the "query options" section

I found I could not select a table or query from within the database I had
opened. Word had merely defaulted to opening one of the two tables in it.
The only querying I could do was on the table it had loaded from the
functions Word provided.

I could not find a way to open any other table let alone a query.

Moreover, I couldn't see a way of importing fields from the database table
that was supposed to be open!

Can you tell me what I'm doing wrong?

Regards,

Hal.

Re: Importing MS Access data into MS Word

am 29.11.2007 12:51:37 von Jebusville

"H" wrote in message
news:l--dne_a9raIAdPanZ2dnUVZ8uydnZ2d@eclipse.net.uk...
> In the thread "combining multiple address fields into 1 address field",
> Stuart (?) helped solve that problem.
>
> I then tried to set up a mail merge in Word to check how I could use and
> merge the data.
>
> I found the database tool bar and opened the appropriate database - but...
> I could not find a way to open a particular table or query in order to
> insert the fields from the query into Word.
>
> The procedure I followed was this:
>
> - open a blank word .doc
> - from the database tool bar selected "insert database"
> - a window opened, headed 'Database' and divided into 3 section:
> at the top a section titled "data source",
> a middle section titled "data options",
> a bottom section titled "insert the data into the document"
>
> - "under "data source" I clicked "get data"
> - a window headed 'Select data source' opened
>
> - I navigated to the relevant database (mobmem07.mdb) and selected it.
> - this added the database location to the "data source" part of the
> 'database' window
>
> - I then looked at the "query options" section
>
> I found I could not select a table or query from within the database I had
> opened. Word had merely defaulted to opening one of the two tables in it.
> The only querying I could do was on the table it had loaded from the
> functions Word provided.
>
> I could not find a way to open any other table let alone a query.
>
> Moreover, I couldn't see a way of importing fields from the database table
> that was supposed to be open!
>
> Can you tell me what I'm doing wrong?
>

Try attacking it from the other end and merge (push) the data into Word from
Access, rather than trying to pull it in from Word. Search the Access help
for Mail Merge.

Keith.

Re: Importing MS Access data into MS Word

am 29.11.2007 13:17:29 von H

Great, I've sussed it.

Many thanks,

Hal.

"Keith Wilby" wrote in message
news:474ea404$1_1@glkas0286.greenlnk.net...
> "H" wrote in message
> news:l--dne_a9raIAdPanZ2dnUVZ8uydnZ2d@eclipse.net.uk...
>> In the thread "combining multiple address fields into 1 address field",
>> Stuart (?) helped solve that problem.
>>
>> I then tried to set up a mail merge in Word to check how I could use and
>> merge the data.
>>
>> I found the database tool bar and opened the appropriate database -
>> but...
>> I could not find a way to open a particular table or query in order to
>> insert the fields from the query into Word.
>>
>> The procedure I followed was this:
>>
>> - open a blank word .doc
>> - from the database tool bar selected "insert database"
>> - a window opened, headed 'Database' and divided into 3 section:
>> at the top a section titled "data source",
>> a middle section titled "data options",
>> a bottom section titled "insert the data into the document"
>>
>> - "under "data source" I clicked "get data"
>> - a window headed 'Select data source' opened
>>
>> - I navigated to the relevant database (mobmem07.mdb) and selected it.
>> - this added the database location to the "data source" part of the
>> 'database' window
>>
>> - I then looked at the "query options" section
>>
>> I found I could not select a table or query from within the database I
>> had opened. Word had merely defaulted to opening one of the two tables in
>> it. The only querying I could do was on the table it had loaded from the
>> functions Word provided.
>>
>> I could not find a way to open any other table let alone a query.
>>
>> Moreover, I couldn't see a way of importing fields from the database
>> table that was supposed to be open!
>>
>> Can you tell me what I'm doing wrong?
>>
>
> Try attacking it from the other end and merge (push) the data into Word
> from Access, rather than trying to pull it in from Word. Search the
> Access help for Mail Merge.
>
> Keith.

Re: Importing MS Access data into MS Word

am 29.11.2007 14:59:30 von DM McGowan II

Hi, Hal. I've done this before, and I can tell you that it works. It'll be
simpler to do it from Word, rather than opening Word from Access through
Automation.

Also, setting up a mail merge in Word from Access can be tricky to set up.
While accessing Word from Access through Automation isn't that difficult,
getting the Word merge settings right can be, depending upon what version
you're using. Even if you use Access to control the process, you'd still be
better off linking your Access data to Word within Word and then just
changing the data from Access and running the merge.

So if you're fine with going into Word and just attaching an Access
database, that would be simpler.

As for why it's not working, queries won't show up in the list. So it has to
be a table. When I've done this in the past, and I had to use a query, I
would first write the query output to a temporary table and then use the
temporary table in the merge.

As for why your tables aren't appearing, I can't really say. In the past,
I've always gotten a complete table list when I did this. You might want to
check in an MS Word newsgroup and see what they say. That would definitely
be a Word issue.

As for importing fields, the merge will import all fields from the table.
You can then select your fields in the document using the toolbar. If you
want to only import some fields, there is a custom SQL option in the Merge
dialogs that will allow you to specify the fields, if that's what you want
to do.

Neil



"H" wrote in message
news:l--dne_a9raIAdPanZ2dnUVZ8uydnZ2d@eclipse.net.uk...
> In the thread "combining multiple address fields into 1 address field",
> Stuart (?) helped solve that problem.
>
> I then tried to set up a mail merge in Word to check how I could use and
> merge the data.
>
> I found the database tool bar and opened the appropriate database - but...
> I could not find a way to open a particular table or query in order to
> insert the fields from the query into Word.
>
> The procedure I followed was this:
>
> - open a blank word .doc
> - from the database tool bar selected "insert database"
> - a window opened, headed 'Database' and divided into 3 section:
> at the top a section titled "data source",
> a middle section titled "data options",
> a bottom section titled "insert the data into the document"
>
> - "under "data source" I clicked "get data"
> - a window headed 'Select data source' opened
>
> - I navigated to the relevant database (mobmem07.mdb) and selected it.
> - this added the database location to the "data source" part of the
> 'database' window
>
> - I then looked at the "query options" section
>
> I found I could not select a table or query from within the database I had
> opened. Word had merely defaulted to opening one of the two tables in it.
> The only querying I could do was on the table it had loaded from the
> functions Word provided.
>
> I could not find a way to open any other table let alone a query.
>
> Moreover, I couldn't see a way of importing fields from the database table
> that was supposed to be open!
>
> Can you tell me what I'm doing wrong?
>
> Regards,
>
> Hal.
>

Re: Importing MS Access data into MS Word

am 29.11.2007 17:04:12 von H

"Neil" wrote in message
news:6Bz3j.21557$4V6.1387@newssvr14.news.prodigy.net...
> Hi, Hal. I've done this before, and I can tell you that it works. It'll be
> simpler to do it from Word, rather than opening Word from Access through
> Automation.

That's what I thought!

> Also, setting up a mail merge in Word from Access can be tricky to set up.
> While accessing Word from Access through Automation isn't that difficult,
> getting the Word merge settings right can be, depending upon what version
> you're using. Even if you use Access to control the process, you'd still
> be better off linking your Access data to Word within Word and then just
> changing the data from Access and running the merge.

Wgat I did was to export a merge .txt file of the query results, opened that
in Word and selected the fields from that.

It seems unneccesarily long winded and if one had a great number of records
would create a massive file. So, while in one sense I have got the data into
Word in a test scenario - it's certainly not in the way I would want to use
it in earnest.

> So if you're fine with going into Word and just attaching an Access
> database, that would be simpler.

You'd have thought it - but it doesn't seem that way to me at the moment!

> As for why it's not working, queries won't show up in the list. So it has
> to be a table. When I've done this in the past, and I had to use a query,
> I would first write the query output to a temporary table and then use the
> temporary table in the merge.

As I mentioned I have 2 tables but only 1 shows - queries don't show at all
as you say.

> As for why your tables aren't appearing, I can't really say. In the past,
> I've always gotten a complete table list when I did this. You might want
> to check in an MS Word newsgroup and see what they say. That would
> definitely be a Word issue.

I'll get me coat.

> As for importing fields, the merge will import all fields from the table.
> You can then select your fields in the document using the toolbar. If you
> want to only import some fields, there is a custom SQL option in the Merge
> dialogs that will allow you to specify the fields, if that's what you want
> to do.

I haven't needed to merge stuff in years and would have thought things would
have become much easier. I can't understand why MS make merging such a
difficult feature to use. Ah well, I better pack my bags and camp out in the
Word group for a while.

> Neil

Hal.

Re: Importing MS Access data into MS Word

am 29.11.2007 18:33:52 von DM McGowan II

> Wgat I did was to export a merge .txt file of the query results, opened
> that
> in Word and selected the fields from that.

Well, that's not too bad of a process. If you keep your filename the same
each time, you can just keep that linked to your merge doc. I don't know if
you're going to run this from Access or Word, but if you run it from Access,
you can just delete the file when you're done. Either way, as long as you
overwrite the same file each time, it shouldn't take up too much disk space.

If all your data's in one table, then it would be better to use that.
Otherwise, if you're taking it from a query, then you'd have to output to
something anyway, whether a file or a temporary table. So it's pretty much
the same.

But, do you mind if I ask why you're using Word instead of just doing an
Access report? If you can do it entirely in Access and avoid Word altogether
that would, of course, be the best solution.

> As I mentioned I have 2 tables but only 1 shows - queries don't show at
> all as you say.

Make sure the tables are all closed. Could be that if the table's open that
Word doesn't show it in the list. In fact, close your database altogether
and see what tables show.

> I haven't needed to merge stuff in years and would have thought things
> would have become much easier. I can't understand why MS make merging such
> a difficult feature to use. Ah well, I better pack my bags and camp out in
> the Word group for a while.

I think most of the Word merge stuff is intended to be used within Word.
Getting data from an external source is considered by MS, I guess, to be
something extra. That's just a guess anyway. But I agree it should be
better.

Neil

Re: Importing MS Access data into MS Word

am 30.11.2007 14:31:50 von rick.bresin

On Nov 29, 4:59 am, "H" wrote:
> In the thread "combining multiple address fields into 1 address field",
> Stuart (?) helped solve that problem.
>
> I then tried to set up a mail merge in Word to check how I could use and
> merge the data.
>
> I found the database tool bar and opened the appropriate database - but...
> I could not find a way to open a particular table or query in order to
> insert the fields from the query into Word.
>
> The procedure I followed was this:
>
> - open a blank word .doc
> - from the database tool bar selected "insert database"
> - a window opened, headed 'Database' and divided into 3 section:
> at the top a section titled "data source",
> a middle section titled "data options",
> a bottom section titled "insert the data into the document"
>
> - "under "data source" I clicked "get data"
> - a window headed 'Select data source' opened
>
> - I navigated to the relevant database (mobmem07.mdb) and selected it.
> - this added the database location to the "data source" part of the
> 'database' window
>
> - I then looked at the "query options" section
>
> I found I could not select a table or query from within the database I had
> opened. Word had merely defaulted to opening one of the two tables in it.
> The only querying I could do was on the table it had loaded from the
> functions Word provided.
>
> I could not find a way to open any other table let alone a query.
>
> Moreover, I couldn't see a way of importing fields from the database table
> that was supposed to be open!
>
> Can you tell me what I'm doing wrong?
>
> Regards,
>
> Hal.

Hal,

Check out Albert Kallal's Super Easy word merge at
http://www.members.shaw.ca/AlbertKallal/wordmerge/
it will be worth your time.
Rick