Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

MS-Access Export Text File Naming Convention

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
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 …

792 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