472,354 Members | 2,171 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,354 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 6465
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...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made but the http to https rule only works for...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and credentials and received a successful connection...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...

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.