473,386 Members | 2,050 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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
Oct 16 '07 #1
22 1871
missinglinq
3,532 Expert 2GB
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)>
Oct 16 '07 #2
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
Oct 17 '07 #3
nico5038
3,080 Expert 2GB
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)
Oct 17 '07 #4
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
Oct 17 '07 #5
nico5038
3,080 Expert 2GB
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)
Oct 17 '07 #6
Brilliant, I will try that. Thanks very much for the advise and have a gr8 day further. Shot, Donovan
Oct 18 '07 #7
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
Nov 5 '07 #8
nico5038
3,080 Expert 2GB
Create a UNION query for your mailmerge like:
Expand|Select|Wrap|Line Numbers
  1. select * from table1
  2. UNION
  3. select * from table2
  4. UNION
  5. select * from table3
  6. UNION
  7. etc...
  8.  
Nic;o)
Nov 5 '07 #9
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!!!
Nov 6 '07 #10
nico5038
3,080 Expert 2GB
In the query-editor switch to SQL mode and enter the SELECT statements as indicated.

Nic;o)
Nov 6 '07 #11
It now says that the number of selected column in the union query do not match.....what now?
Nov 6 '07 #12
nico5038
3,080 Expert 2GB
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)
Nov 6 '07 #13
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
Nov 7 '07 #14
nico5038
3,080 Expert 2GB
When the datatype can be kept equal, you can use "dummy" fields in the table with 3 fields like:
Expand|Select|Wrap|Line Numbers
  1. UNION
  2. select field1, field2, field3, "" as FieldText4, 0 as FieldNum5, Null as FieldDat6, ... etc..
  3. UNION
  4.  
Nic;o)
Nov 7 '07 #15
Thanks,

I'll try that and let you know how it goes. I hope I can get this right now :)
Shot for all the help so far.

Kindest Regards,
Donovan
Nov 8 '07 #16
Joy, I pulled my first report yesterday and it is working like a charm :) Thank you so much for all the brilliant advice.

But....

Now there is another problem...When I have more than one dataset in the database, ie. more than one row, it looks like when I do a mailmerge, it carries on looping between the two or more datasets and creating all those reports over and over. If the report is about 8 pages, it ends up being about 2,500 pages long....

Any ideas about this?

Thanks,
Donovan
Nov 9 '07 #17
nico5038
3,080 Expert 2GB
Strange, did you check or the query does deliver the rows properly ?
I get the impression you get a "Cartesian" product, but a UNION query shouldn't suffer from that.

Is the number of copies for the Word document = 1 ?

Nic;o)
Nov 9 '07 #18
Hey there,

I feel like a bit of a nut now...it was an error in my program to begin with...but it is sorted now :)

I now am heading toward my final stretch...all I need to sort out now is the following: When I enter data into the table, from the program I created, the table get's sorted alphabetically by default...however, this is not good in an 11 table environment as I need the information inserted to remain the same throughout the tables ie. row one must be row one in all the tables, row two must be row two in all the tables etc. If I can get this working, I will have my program finished :) At long last.

Do you have any ideas? Please save me ... hahaha

Thanks and Regards,
Donovan
Nov 12 '07 #19
nico5038
3,080 Expert 2GB
Use a UNION like:
Expand|Select|Wrap|Line Numbers
  1. select "1" as tableno, * from table1
  2. UNION ALL
  3. select "2" as tableno, * from table2
  4. UNION ALL
  5. select "3" as tableno, * from table3
  6. ...etc
  7. ORDER BY 1, 2
  8.  
The ALL is needed, and the added field Tableno will sort the table's in sequence for the added number and the first column of the table. Just make sure that the first table field is the unique ID in sequence needed.

Nic;o)
Nov 12 '07 #20
Another question please...is there a way to automatically populate all the fields in a database that share a name with the information in one table through to the different tables?
Nov 13 '07 #21
nico5038
3,080 Expert 2GB
No. Normally this requirement points to the recording of redundant data and that's a "DON'T" in a normalized database.

Nic;o)
Nov 13 '07 #22
Hey there,

Shot for all the help, you have been a life saver and hopefully one day I can help aswell. My program is running perfectly and I have completed my project to present on Monday :)

Thanks again and Have a good one,
Kindest Regards,
Donovan
Nov 14 '07 #23

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: mickeydisn | last post by:
Sub: C++ Word automation Extract text hello. I want extact text form a word document using a visual c++ programme. I have see a lot of documentation. and my analysis is that I must use a...
3
by: Adam Faulkner via DotNetMonster.com | last post by:
I want to create a method within a class that opens a Microsoft Word 2000 Document and has the facility to Create a new word document and then extract a Page that exists within the original Word...
0
by: Adam Faulkner via DotNetMonster.com | last post by:
I want to create a method within a class that opens a Microsoft Word 2000 Document and has the facility to Create a new word document and then extract a Page that exists within the original Word...
0
by: Adam Faulkner via DotNetMonster.com | last post by:
I want to create a method within a class that opens a Microsoft Word 2000 Document and has the facility to Create a new word document and then extract a Page that exists within the original Word...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.