Solved

MS-Access Export Text File Naming Convention

Posted on 2012-04-10
3
260 Views
Last Modified: 2012-04-17
Hi,

I'm not sure how difficult this is...but any help would be greatly appreciated. I have a table that I want to export into seperate files based on the data.  For example:

Table X has the following fields:

Name (John Smith, Joanne Smithers, Jordan Simpson)
ItemCategory (Shirt, Shoes, Socks)
OrderDate (04/10/2012, 04/12/2012, 04/15/2012)
RecurringOrder (monthly, weekly, yearly)

I want to create seperate CSV files based on the ItemCategory, OrderDate, and RecurringOrder.

Socks_4-10-2012_weekly.csv
Shirt_4-12-2012_monthly.csv
Shoes_4-15-2012_yearly.csv

So, when someone imports the Socks_4-10-2012_weekly.csv - they'll be getting all the records in the table that are for Socks that were ordered on 4-10-2012 and has a recurringOrder of weekly.

How can I export these .csv files from the same table source?

Thank you,
0
Comment
Question by:mds_1
3 Comments
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 37830176
create a query using those criteria

select * from tableX
where itemcategory="socks" and OrderDate=#4/10/2012# and RecurringOrder="weekly"


you can use a form with three combo boxes, for itemCategory, OrderDate, and recurringorder

so the query criteria will be based upon the selections in the combo boxes.. like this

select * from tableX
where itemcategory=Forms!YourFormName!comboCategory and OrderDate=Forms!YourFormName!comboOrderDate and RecurringOrder=Forms!YourFormName!comboRecurringOrder


save the query as "myQuery", then export as .csv file
0
 
LVL 21

Accepted Solution

by:
Boyd (HiTechCoach) Trimmell, Microsoft Access MVP earned 500 total points
ID: 37830178
I would create separate queries to select the desired data for each export.
0
 

Author Closing Comment

by:mds_1
ID: 37857019
thank you - i ended up creating multiple queries to get it to export correctly.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question