473,378 Members | 1,346 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,378 software developers and data experts.

Open MS Word and Insert Data

I am helping a friend with an Access DB and I am having trouble with this:
I have 2 drop down boxes in a form. In one, the user will select the customer name from a table, and the other the specific MS Word document to be opened.
What I am trying to accomplish is to open the Word document and once is opened, it automaticly inserts the customer name, address and other information from the respective table.
Please help!
Thanks
Aug 26 '06 #1
3 3128
PEB
1,418 Expert 1GB
Hi
U can do it by:

1. When you create the documents in MS Word, you have to use the Tools/Letters and mailings/ Mail Merge. This 'll create a document type that will get the information from your MS Access Query with the information about your customers

2. In Access you create a query that contains the info about your customer that is choosen from the list

3. U use the shell(Path, type of opening) to start MS Word and the specified Document

4. In word u click on Merge the document and it's ready!
Aug 29 '06 #2
Hi
U can do it by:

1. When you create the documents in MS Word, you have to use the Tools/Letters and mailings/ Mail Merge. This 'll create a document type that will get the information from your MS Access Query with the information about your customers

2. In Access you create a query that contains the info about your customer that is choosen from the list

3. U use the shell(Path, type of opening) to start MS Word and the specified Document

4. In word u click on Merge the document and it's ready!
Thanks for the answer, but wouldn't this create a mail merge with all the clients in the query? I just want one particular client on the document I am going to print.
Jorge
Aug 31 '06 #3
PEB
1,418 Expert 1GB
Just this will create a merge with all info in the query! So to have the specified client you can use the follow code for creating an appropriate query:

Set mydb = CurrentDb()
Set Myquery = mydb.CreateQueryDef(names, SQLS)

SQLS is your query SQL where you specify the customer ID that you would like to appear!

Before Save the new SQL you should delete the ancient query!

So you have to insert those statements in On click event in the lists!
Sep 1 '06 #4

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

Similar topics

2
by: JP SIngh | last post by:
HI All I just wonder if anyone has created a word document using ASP. I am able to create a work document with ASP without any problem but what I want to do is slightly more than I know. I am...
6
by: Ryan Muller | last post by:
My company just upgraded from Access 97 to Access 2003 today and we are having some issues in a database that generates a Word document from information selected in a form. Here is the code we...
1
by: ajk | last post by:
. Hi, All: I know how to insert files into a Word doc using C#. However, the program I've written to do this runs much too slowly. The "myObj".Application.Selection.InsertFile method executes...
1
by: musicloverlch | last post by:
I have a problem. I have an Access 2003 report that contains a number of Word and Excel objects with fancy formatting and spreadsheets, etc. I have about 20 records that I am having the database...
4
by: Fabian | last post by:
Hello, I want to open a Word Document in my C# Programm. I tried this : Word.Application wordapp = new Word.Application(); object path = "TEST.DOC"; object vk_read_only = false; object...
2
by: jmar | last post by:
I am updating a VB4.0 quote generation program to VB.net. The old program takes user inputs, performs calculations, saves the data to Access databases and uses Crystal Reports 5.0 to generate a...
20
by: fniles | last post by:
I am using VB.NET 2003, SQL 2000, and SqlDataReader. As I read data from tblA, I want to populate tblB. I use SQLDataReader for both tables. I do not use thread. When I ExecuteReader on tblB, I...
5
by: coolminded | last post by:
hi everyone i have a problem, i just export the data from data grid to the word file, but now the problem is i want to insert the picture in the word with the path name in the grid. for ex; i...
2
by: =?Utf-8?B?R1ROMTcwNzc3?= | last post by:
Hi there, I'm hoping this is the place to submit this, as really I am looking to resolve the issue before the data is sent to the database. I have a website, with a textarea, that stores data...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.