Extract info from Acc2003 and insert into a Word document at a specific point

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • donovans
    New Member
    • Oct 2007
    • 21

    Extract info from Acc2003 and insert into a Word document at a specific point

    Hey there,

    Is there a way to extract information from Microsoft Access 2003 and insert it into a specific location in a Microsoft Word 2003 document?

    Please assist,
    Thanks and Regards,
    Donovan
  • missinglinq
    Recognized Expert Specialist
    • Nov 2006
    • 3533

    #2
    This posting has been edited to facilitate reading. A portion of the post, related to Java development, has been moved to the Java Forum.

    Wlcome to TheScripts!

    Linq ;0)>

    Comment

    • donovans
      New Member
      • Oct 2007
      • 21

      #3
      Thank you. I am really hoping that this helps, as I am out of ideas now. I am a little edgy as to the processes to follow now. But thanks for the site that has been set up to assist us unhappy and unlucky souls.

      Regards,
      Donovan

      Comment

      • nico5038
        Recognized Expert Specialist
        • Nov 2006
        • 3080

        #4
        Basically you have two options:
        1) Use the Mailmerge option from MS Word
        2) Use automation from VBA code to manipulate the document using the Word object model.
        The Mailmerge is "the easy way out", for the other option you'll first need to ask yourself how good your VBA coding is.

        Nic;o)

        Comment

        • donovans
          New Member
          • Oct 2007
          • 21

          #5
          Hey there. Thanks very much for the advice. I definately want to go the Mailmerge route, however I have never heard of it, much less used it...any insight into it will really be appreciated. Regards, Donovan

          Comment

          • nico5038
            Recognized Expert Specialist
            • Nov 2006
            • 3080

            #6
            Just open MS Word and look for the Mailmerge menu/wizard.
            One option is to get data from "outside" and an Access database is one of them.
            Best to create a Query that holds the needed data, thus making sure that future table changes can be handled within the Access query and has no changes for Word.

            Success !

            Nic;o)

            Comment

            • donovans
              New Member
              • Oct 2007
              • 21

              #7
              Brilliant, I will try that. Thanks very much for the advise and have a gr8 day further. Shot, Donovan

              Comment

              • donovans
                New Member
                • Oct 2007
                • 21

                #8
                Hey there again,

                Please assist, I am using MailMerge and it is working brilliantly, but I can only import information from one place in my database, but I have 11 tables, how do I create multiple mailmerges?

                Thanks,
                Donovan

                Comment

                • nico5038
                  Recognized Expert Specialist
                  • Nov 2006
                  • 3080

                  #9
                  Create a UNION query for your mailmerge like:
                  [code=sql]
                  select * from table1
                  UNION
                  select * from table2
                  UNION
                  select * from table3
                  UNION
                  etc...
                  [/code]

                  Nic;o)

                  Comment

                  • donovans
                    New Member
                    • Oct 2007
                    • 21

                    #10
                    How do you do this? I have never done a union query before. I will try the Help file on a union query through Word, hopefully this works...thanks very much for the help, ur a life saver!!!

                    Comment

                    • nico5038
                      Recognized Expert Specialist
                      • Nov 2006
                      • 3080

                      #11
                      In the query-editor switch to SQL mode and enter the SELECT statements as indicated.

                      Nic;o)

                      Comment

                      • donovans
                        New Member
                        • Oct 2007
                        • 21

                        #12
                        It now says that the number of selected column in the union query do not match.....what now?

                        Comment

                        • nico5038
                          Recognized Expert Specialist
                          • Nov 2006
                          • 3080

                          #13
                          Only select the fields needed and the same number of fields per table.
                          Make sure they have the same datatype (Text, Number, Date) in the same column.
                          Names don't matter.

                          Nic;o)

                          Comment

                          • donovans
                            New Member
                            • Oct 2007
                            • 21

                            #14
                            Thanks for the reponse, I have up to 11 fields at a go on some tables and then about 3 on others....is there any way? If so please help me.....Thanks

                            Comment

                            • nico5038
                              Recognized Expert Specialist
                              • Nov 2006
                              • 3080

                              #15
                              When the datatype can be kept equal, you can use "dummy" fields in the table with 3 fields like:
                              [code=sql]
                              UNION
                              select field1, field2, field3, "" as FieldText4, 0 as FieldNum5, Null as FieldDat6, ... etc..
                              UNION
                              [/code]

                              Nic;o)

                              Comment

                              Working...