Results 1 to 2 of 2
  1. #1
    albno is offline Novice
    Windows 7 32bit Access 2010 64bit
    Join Date
    Dec 2011
    Posts
    1

    how to fill one word doc with multiple records

    This code works already
    Code:
        'set up a connection to the database
        Dim cnn1 As ADODB.Connection
        Set cnn1 = CurrentProject.Connection
        
        'set up a recordset
        Dim myRS As New ADODB.Recordset
        myRS.ActiveConnection = cnn1
        
        'create query based on the sama tabel to which the subform is bound
        'use data form the main form to filter the related data
        Dim mySQL As String
        mySQL = "SELECT Boekingen_setlist.BoekingID, Bands_Setlist.Titel, Bands_Setlist.Uitvoerder, Bands_Setlist.[Genre/versie], Bands_Setlist.[duur van het werk]FROM Boekingen_setlist INNER JOIN Bands_Setlist ON Boekingen_setlist.Titel = Bands_Setlist.[Setlist-ID]WHERE (((Boekingen_setlist.BoekingID)=" & Me.Boeking_ID & "))"
        
        'open a recordset based on the query just created
        myRS.Open mySQL
        
        'check te make sure the recordset has records in it
        If myRS.BOF And myRS.EOF Then
            MsgBox "No Related Data"
            Exit Sub
        End If

    I already know how it works to fill Word Form Fields for one reccord
    how do you manage multiple records into a Word document in a table


    sorry for my english, it's google translate

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    Google: access vba build table in word document with access data

    A word document can link to an Access table or query http://www.techrepublic.com/blog/mso...ccess-data/489

    This thread appears to have partial answer http://www.dbforums.com/microsoft-ac...nt-access.html
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Access to Word - Multiple Word Templates?
    By alpinegroove in forum Programming
    Replies: 11
    Last Post: 06-12-2012, 04:42 PM
  2. Replies: 16
    Last Post: 11-02-2011, 01:35 PM
  3. Access to Word Form Fill
    By defy in forum Programming
    Replies: 1
    Last Post: 10-04-2011, 12:10 AM
  4. Multiple Auto Fill in Form
    By mwebster in forum Forms
    Replies: 1
    Last Post: 07-06-2011, 10:39 AM
  5. How To Fill In Multiple Fields From A Form
    By SamanthaSamuels in forum Access
    Replies: 3
    Last Post: 08-16-2010, 12:13 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums