Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Apr 2003
    Thanked 0 Times in 0 Posts

    Extracting data from Access database into Word (Word 2000)

    I need to create a macro in Word using vba to create a dialog box which will contain a ComboBox control. This ComboBox needs to be populated by a specific field in an Access database table. Based on the item you select in this box, I then need to insert that item as well as other information associated with that recordset into my document.

    For example, the list is of individuals in a table with their phone number and email address as other fields in the record. When you select a certain individual it will not only put in that name in the document in a specific location but also at other bookmarked locations information in the same recordset such as the phone number and email address.


  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Silicon Valley, USA
    Thanked 94 Times in 90 Posts

    Re: Extracting data from Access database into Word (Word 2000)

    Inserting text into Word is trivial. The Word part is more or less to select a bookmark in the activedocument and use Selection.TypeText objRS("MyField") to insert the desired data from your recordset. Repeat until finished.

    The harder part is the Access part, but there are some special controls (with names like DataGrid, I think) that help you in working with Access data. I'm going to move this thread over to the Access board so you can get help on the harder parts.

  3. #3
    Super Moderator
    Join Date
    Aug 2001
    Evergreen, CO, USA
    Thanked 65 Times in 64 Posts

    Re: Extracting data from Access database into Word (Word 2000)

    Why don't you use automation and kick the process off from Access (see my signature for a simple tutorial)? It has very flexible forms that can do exactly what you want. On the other hand, a Word merge from an Access data source will also do the trick, and doesn't necessarily involve any VBA.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts