Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to separate a table's values into separate spreadsheets ?

Status
Not open for further replies.

GarHeard

Programmer
May 3, 2005
28
US
I am creating an Access application using Access as the front end and SQL Server as the backend database.

I have a table named tblA consisting of the following 2 fields:

Branch Customer
---------- --------------
1 121
1 122
1 135
2 166
2 194
2 276
3 299
3 300
3 388
4 389
4 444
5 446
6 469
6 478

How would you break this up so that you could have each unique Branch generate a separate Excel Spreadsheet consisting of rows for each Customer within each Branch.

For example:

Branch1.XLS

Customer
121
122
135
-----------------------
Branch2.XLS

Customer
166
194
276
-----------------------

ExportedFile = "C:\BRANCH & ".XLS"
DoCmd.TransferSpreadsheet acExport, 8, "tblA", ExportedFile, True, ""

 
You really need to go out and buy a basic introduction to Access.

 
GarHeard,

Welcome to Tek-Tips (a little belated, but Welcome nonetheless!)

For everyone's benefit, when you get a chance could you explain (with some degree of detail) why you need to export the data to Excel from Access? What are you going to do with the data once it's in Excel?

I suspect whatever you're trying to do might be accomplished all within Access, which would be easier, cleaner, etc.

Good Luck!
Tim

[blue]_____________________________________________________
If you need immediate assistance, please raise your hand.
If you are outside of Raleigh, raise your hand and say
[/blue] [red]Ooh! Ooh![/red]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top