Questions

Word document linked to Access

Tags:
+
0 Votes
Locked

Word document linked to Access

michaelfuhrman
I have an access db with records of transactions. After each transaction I need to generate a confirmation in a word document. How can I link the fields in Word to the appropriate, corresponding fields in the Access db? Can I run a macro to automatically generate a word doc after each transaction?
  • +
    0 Votes

    1. Why not create a Hyperlink to the Word Document?
    2. If you still want to Link the Word Document, and not have it bound:
    1. Enter Form Design View
    2. Insert ==> Object
    3. Select Create from File
    4. Select Link
    5. Browse ==> Select File
    6. OK ==> OK
    7. Set the Enabled Property of the Unbound Object Frame to Yes

    Read more here:
    http://bytes.com/forum/thread718991.html

    Please post back if you have any more problems or questions.

    +
    0 Votes
    michaelfuhrman

    After entering a new record in the access db I want to hit a command button that opens an instance of Word, copies the data fields from the most recent record and deposits them next to labels in the Word doc. Ex: if cell A2 in the db is "buyer", then this data would appear next to Buyer in the word doc.

    +
    0 Votes

    Dynamically generate ms word document using vba access 2007.

    There are many ways to approach this
    ' problem. I usually begin with a word
    ' template containing the structure of
    ' the table I want to populate. Then
    ' open the template from vba in excel
    ' and begin inserting table records.

    Set wdApp = CreateObject("Word.Application")
    wdApp.Visible = True
    Set wdDoc = wdApp.Documents.Add("Bill.dot")
    Set wdTbl = wdDoc.Tables(1) ' containing table

    ' I use a function to actually populate
    ' the rows passing it the table id name
    ' and row data.

    Set wdInTbl = wdTbl.Tables(2) ' table in a table

    SetTableRow wdInTbl, idx, prevDate & "|" & _
    prevJob & "|" & _
    Format(prevTime, decFmt) & "|" & _
    prevRate & "|" & _
    Format(prevAmount, dolFmt)

    Sub SetTableRow(tbl As Word.Table, row As Integer, lbl As String)

    http://visualbasic.ittoolbox.com/groups/technical-functional/vb-vba-l/dynamically-generate-ms-word-document-using-vba-access-2007-2190479#

    Please post back if you have any more problems or questions.

    +
    0 Votes
    allouttr

    Yes, you can program a Word template (macro in VBA) to do things like scanning aWord document for data items/fields in an Access DB. In the database you would first scan for a list of data items you want to confirm are in the Word doc then you use VBA scanning of the text in the document to see if those items are present and where they are located (page, line, column). You could also probably scan a Word table with VBA to see if they are there.

    John James
    All-Out Solutions, Inc.

    +
    0 Votes
    allouttr

    Yes, you can program a Word template (macro in VBA) to do things like scanning aWord document for data items/fields in an Access DB. In the database you would first scan for a list of data items you want to confirm are in the Word doc then you use VBA scanning of the text in the document to see if those items are present and where they are located (page, line, column). You could also probably scan a Word table with VBA to see if they are there.

    John James
    All-Out Solutions, Inc.

  • +
    0 Votes

    1. Why not create a Hyperlink to the Word Document?
    2. If you still want to Link the Word Document, and not have it bound:
    1. Enter Form Design View
    2. Insert ==> Object
    3. Select Create from File
    4. Select Link
    5. Browse ==> Select File
    6. OK ==> OK
    7. Set the Enabled Property of the Unbound Object Frame to Yes

    Read more here:
    http://bytes.com/forum/thread718991.html

    Please post back if you have any more problems or questions.

    +
    0 Votes
    michaelfuhrman

    After entering a new record in the access db I want to hit a command button that opens an instance of Word, copies the data fields from the most recent record and deposits them next to labels in the Word doc. Ex: if cell A2 in the db is "buyer", then this data would appear next to Buyer in the word doc.

    +
    0 Votes

    Dynamically generate ms word document using vba access 2007.

    There are many ways to approach this
    ' problem. I usually begin with a word
    ' template containing the structure of
    ' the table I want to populate. Then
    ' open the template from vba in excel
    ' and begin inserting table records.

    Set wdApp = CreateObject("Word.Application")
    wdApp.Visible = True
    Set wdDoc = wdApp.Documents.Add("Bill.dot")
    Set wdTbl = wdDoc.Tables(1) ' containing table

    ' I use a function to actually populate
    ' the rows passing it the table id name
    ' and row data.

    Set wdInTbl = wdTbl.Tables(2) ' table in a table

    SetTableRow wdInTbl, idx, prevDate & "|" & _
    prevJob & "|" & _
    Format(prevTime, decFmt) & "|" & _
    prevRate & "|" & _
    Format(prevAmount, dolFmt)

    Sub SetTableRow(tbl As Word.Table, row As Integer, lbl As String)

    http://visualbasic.ittoolbox.com/groups/technical-functional/vb-vba-l/dynamically-generate-ms-word-document-using-vba-access-2007-2190479#

    Please post back if you have any more problems or questions.

    +
    0 Votes
    allouttr

    Yes, you can program a Word template (macro in VBA) to do things like scanning aWord document for data items/fields in an Access DB. In the database you would first scan for a list of data items you want to confirm are in the Word doc then you use VBA scanning of the text in the document to see if those items are present and where they are located (page, line, column). You could also probably scan a Word table with VBA to see if they are there.

    John James
    All-Out Solutions, Inc.

    +
    0 Votes
    allouttr

    Yes, you can program a Word template (macro in VBA) to do things like scanning aWord document for data items/fields in an Access DB. In the database you would first scan for a list of data items you want to confirm are in the Word doc then you use VBA scanning of the text in the document to see if those items are present and where they are located (page, line, column). You could also probably scan a Word table with VBA to see if they are there.

    John James
    All-Out Solutions, Inc.