> It is definitely possible using vba.
>
[quoted text clipped - 77 lines]
> >> >> >
> >> >> > TIA
This code will add a table to the document at the location of the selection
(or some other range object) and populate it with data from the records in
the table in the database. It is necessary to set a reference in the Visual
Basic Editor (Tools>Reference) to the Microsoft DAO #.# Object Library for
it to work.
Dim myDataBase As Database
Dim myActiveRecord As Recordset
Dim i As Long
Dim dtable As Table, drow As Row
'Open a database
Set myDataBase = OpenDatabase("c:\Access\Procurement Plan.mdb") 'use your
own database
'Access the first record from a particular table
Set myActiveRecord = myDataBase.OpenRecordset("Currencies",
dbOpenForwardOnly) 'use your own table
'Add a table to the document with one row and as many fields as there are in
the database table
Set dtable = ActiveDocument.Tables.Add(Range:=Selection.Range, NumRows:=1,
numcolumns:=myActiveRecord.Fields.Count)
Set drow = dtable.Rows(1)
'Loop through all the records in the table until the end-of-file marker is
reached
Do While Not myActiveRecord.EOF
'Populate the cells in the Word table with the data from the current
record
For i = 1 To myActiveRecord.Fields.Count
drow.Cells(i).Range.Text = myActiveRecord.Fields(i - 1)
Next i
'Add a new row to the Word table and access the next record
Set drow = dtable.Rows.Add
myActiveRecord.MoveNext
Loop
'The last row will be empty, so delete it
drow.Delete
'Then close the database
myActiveRecord.Close
myDataBase.Close

Signature
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP
> Doug
>
[quoted text clipped - 98 lines]
>> >> >> >
>> >> >> > TIA
MTechG - 16 Dec 2005 19:08 GMT
Doug
Thanks a bunch for your help on this issue. I'm pretty much on the same
track as your code. I will use it as a refernce though.
Dennis
> This code will add a table to the document at the location of the selection
> (or some other range object) and populate it with data from the records in
[quoted text clipped - 137 lines]
> >> >> >> >
> >> >> >> > TIA