Solved

MS-Access Export Text File Naming Convention

Posted on 2012-04-10
3
218 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 119

Expert Comment

by:Rey Obrero
Comment Utility
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
Comment Utility
I would create separate queries to select the desired data for each export.
0
 

Author Closing Comment

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

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

772 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now