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

Split One table to multiple Excel files

Jen
Trying to take one table in access and split it into multiple excel
files(using an excel template); and then email based on email
addresses in Table2; Of course, I would like to do all of this with
minimum user-interface...If there is anyone out there that can help...
please feel free to share!:)
PS... Using MSOffice 2000
Example:
Table1

Record# Vendor Field1 Field2 Field3 Field4 Field5
1 12345 450000 $1.00 12 $12.00 10-Nov-2004
2 24689 50000 $3.00 1 $ 3.00 10-Dec-2004
3 12345 808500 $5.00 5 $25.00 10-Dec-2004
4 12345 450000 $1.00 12 $12.00 10-Nov-2004
..
..
n 56798 12000 $10.00 1 $10.00 15-Mar-2005

Result I want in an Excel spreadsheets:
Spreadsheet 1 File name: Vendor_12345_22-Oct-2004.xls
Vendor Field1 Field2 Field3 Field4 Field5
12345 450000 $1.00 12 $12.00 10-Nov-2004
12345 808500 $5.00 5 $25.00 10-Dec-2004
12345 450000 $1.00 12 $12.00 10-Nov-2004

Spreadsheet2 File name: Vendor_24689_22-Oct-2004.xls
Vendor Field1 Field2 Field3 Field4 Field5
24689 50000 $3.00 1 $ 3.00 10-Dec-2004
Spreadsheet3 File name: Vendor_56798_22-Oct-2004.xls
Vendor Field1 Field2 Field3 Field4 Field5
56798 12000 $10.00 1 $10.00 15-Mar-2005

Table2
Vendor# Contact Email
12345 Smith, Joe jo******@xxxx.com
24689 Doe, Jane ja*****@xxxx.com
56798 Help, Me he****@xxxx.com
Nov 13 '05 #1
2 6632
jc*****@celestica.com (Jen) wrote in message news:<93**************************@posting.google. com>...
Trying to take one table in access and split it into multiple excel
files(using an excel template); and then email based on email
addresses in Table2; Of course, I would like to do all of this with
minimum user-interface...If there is anyone out there that can help...
please feel free to share!:)
PS... Using MSOffice 2000
Example:
Table1

Record# Vendor Field1 Field2 Field3 Field4 Field5
1 12345 450000 $1.00 12 $12.00 10-Nov-2004
2 24689 50000 $3.00 1 $ 3.00 10-Dec-2004
3 12345 808500 $5.00 5 $25.00 10-Dec-2004
4 12345 450000 $1.00 12 $12.00 10-Nov-2004
.
.
n 56798 12000 $10.00 1 $10.00 15-Mar-2005

Result I want in an Excel spreadsheets:
Spreadsheet 1 File name: Vendor_12345_22-Oct-2004.xls
Vendor Field1 Field2 Field3 Field4 Field5
12345 450000 $1.00 12 $12.00 10-Nov-2004
12345 808500 $5.00 5 $25.00 10-Dec-2004
12345 450000 $1.00 12 $12.00 10-Nov-2004

Spreadsheet2 File name: Vendor_24689_22-Oct-2004.xls
Vendor Field1 Field2 Field3 Field4 Field5
24689 50000 $3.00 1 $ 3.00 10-Dec-2004
Spreadsheet3 File name: Vendor_56798_22-Oct-2004.xls
Vendor Field1 Field2 Field3 Field4 Field5
56798 12000 $10.00 1 $10.00 15-Mar-2005

Table2
Vendor# Contact Email
12345 Smith, Joe jo******@xxxx.com
24689 Doe, Jane ja*****@xxxx.com
56798 Help, Me he****@xxxx.com

Start by reading this article:

http://www.mvps.org/access/modules/mdl0035.htm

This is ONE of several ways to put your data into Excel. If you want
others, I'm sure other people have different methods. I'm sure Rich
P, who usually hangs out in the SQL Server NG will have some good
ideas. He generally uses VBA, but it gives you a LOT more control
over what's going on - like filenames etc. But in your case it looks
like VendorName & "_" & SomeID & Day(Date)..., in other words VERY
easy to automate.

if you wanted to output the files only to e-mail them, you could use
SendObject, but it does have its limitations.

So you want to do something like (Anybody feel free to correct/augment
whatever):
1. open a recordset based on a SQL statement on your addresses table,
call ir rs Recipients.
2. use that as criteria for another recordset, say rsData.
3. use the data from rsRecipients to filter rsData. If you use ADO,
you can pass the recordset stuff directly to an Excel file/template.
(This is where RichP could take over...)

Okay, so now you have your data from Access and into Excel. (I'll
assume that anyway.)

So now all you have to do is automate your e-mail. Dmitri Furman has
code that automates GroupWise... best bet, check Tony Toew's page on
how to do all this good stuff. Can't remember his URL off the top of
my head, but he has zillions of postings here, and it's in his sig.
Either that or check the MVPs section of AccessWeb (open the url I
gave you earlier).

You basically automate your favorite e-mail client and then create a
new message, insert Recipient, Subject, BodyText, and Attachment info,
and Send. If you don't like mucking with the Outlook object model, at
least there used to be a library available from MS, called CDONTS,
which is a wrapper class that simplifies automating Outlook. Don't
know what it's morphed into now, but that greatly simplifies things.
You just pass the information into this wrapper class and it takes
care of the automation internally. Or you could use BLAT. Ask Steve
Jorgensen about that, as I know he uses that.

Hope that gives you some options. If I were you, I would search the
NG for the names etc I gave you. I know for sure all the answers are
here, because I've read them over the years. All you have to do is
find them. Happy Hunting!

HTH,
Pieter
Nov 13 '05 #2
dog
There are many ways you could do this but what I who do first of all
it create a single query in access which holds all you information.
There would have to be a relationship between your 2 tables so that
you could do this (i.e. Vendor ID)

Once you have your query, set a parameter on the Vendor ID (id use a
QueryDef in your code) and use a Do Until Loop in your code which will
loop through all the unique Vendors and their related information.

You need to set a reference in your code to the Excel Object library,
declare the excel object in your module, and inside your code
everytime you loop through each set of records, you need to open your
template file, use the CopyFromRecordset or Offset methods to get the
data in there, and save the file.

The user need only click a button for it to all be done automatically.

Dog

jc*****@celestica.com (Jen) wrote in message news:<93**************************@posting.google. com>...
Trying to take one table in access and split it into multiple excel
files(using an excel template); and then email based on email
addresses in Table2; Of course, I would like to do all of this with
minimum user-interface...If there is anyone out there that can help...
please feel free to share!:)
PS... Using MSOffice 2000
Example:
Table1

Record# Vendor Field1 Field2 Field3 Field4 Field5
1 12345 450000 $1.00 12 $12.00 10-Nov-2004
2 24689 50000 $3.00 1 $ 3.00 10-Dec-2004
3 12345 808500 $5.00 5 $25.00 10-Dec-2004
4 12345 450000 $1.00 12 $12.00 10-Nov-2004
.
.
n 56798 12000 $10.00 1 $10.00 15-Mar-2005

Result I want in an Excel spreadsheets:
Spreadsheet 1 File name: Vendor_12345_22-Oct-2004.xls
Vendor Field1 Field2 Field3 Field4 Field5
12345 450000 $1.00 12 $12.00 10-Nov-2004
12345 808500 $5.00 5 $25.00 10-Dec-2004
12345 450000 $1.00 12 $12.00 10-Nov-2004

Spreadsheet2 File name: Vendor_24689_22-Oct-2004.xls
Vendor Field1 Field2 Field3 Field4 Field5
24689 50000 $3.00 1 $ 3.00 10-Dec-2004
Spreadsheet3 File name: Vendor_56798_22-Oct-2004.xls
Vendor Field1 Field2 Field3 Field4 Field5
56798 12000 $10.00 1 $10.00 15-Mar-2005

Table2
Vendor# Contact Email
12345 Smith, Joe jo******@xxxx.com
24689 Doe, Jane ja*****@xxxx.com
56798 Help, Me he****@xxxx.com

Nov 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: kumu | last post by:
How to Split a XML file to multiple small XML Files Hello, I am trying to split a XML file to multiple small xml files in vb.net and am trying to get the best possible approach to this. Any help...
1
by: mia456789 | last post by:
I hv a mysql db in my RH linux , there is a very large table in the db , the file size is about 2G , how can I split the file into two files - two files physically and one file logically ? is ...
0
by: Eliezer Figueroa | last post by:
Managing Multiple Excel incoming files? I have this situation. I have a client which have several locations they work primary with excel forms and they are thinking in doing reports with them....
1
by: poohnie08 | last post by:
i have a excel spreadsheet showing staff name, date,work hour, ot hour, slot1, slot2, slot3, slot4 and others). The "()" will keep repeating from day 1 until end of month. eg in excel spreadsheet,...
6
by: Stan | last post by:
I am working on a database in ACCESS 2003. This is a simple DB with only one table. I have split the DB so I can upgrade and debug the front end before installing on my clients' computer. I used...
7
by: TG | last post by:
hi! I am trying to create a sql server table from an excel sheet. Here is the code I have: 'This procedure the xlsx file and dumps it to a table in SQL Server
4
by: Twilight | last post by:
There is a table tbl1,with several fields, one of them is City, with the value varies from city1 to city30. I want to use Access Marco to automatically using function transferspreadsheet to copy...
7
by: franc sutherland | last post by:
Hi everyone, I am using Access 2003. I have a database with a table in it which is linked to an excel spreadsheet. When I install the database on someone else's system, the pathname to the...
3
by: stephen | last post by:
Hi, I have 5 excel files and they have multiple sheets. I have to read (say sheet 3) of each of the 5 excel files and consolidate them into one. what's the best way to achieve this. if someone...
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
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...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.