Export to Text Files Based on Field Value

I have an Access table with personal information (e.g., first name, last name,
birth date, etc.) for thousands of people. The table is sorted by state. I
want to be able to run a macro on that table that will create separate pipe
delimited text files for each state with all fields included.

Any help would be appreciated?

-- 
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-queries/201005/1

0
Leviathan
5/21/2010 5:45:44 PM
access.queries 6343 articles. 1 followers. Follow

1 Replies
853 Views

Similar Articles

[PageSpeed] 36

Instead of exporting the table, export a query based on the table. You will 
have to have some code that loops through the states and modifies the query 
each time.

John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County

Leviathan via AccessMonster.com wrote:
> I have an Access table with personal information (e.g., first name, last name,
> birth date, etc.) for thousands of people. The table is sorted by state. I
> want to be able to run a macro on that table that will create separate pipe
> delimited text files for each state with all fields included.
> 
> Any help would be appreciated?
> 
0
John
5/21/2010 6:56:18 PM
Reply:

Similar Artilces:

Pivot Table Cycling Through Page Fields Automatically
Hi. I am trying to cycle through a complete set of data in one of the parameters in the "Page" field. For example, there are 500 investments, and I want to compute the internal rate of return (IRR) for each investment based on a series of cashflows for each investment. The IRR is a function that is placed outside the pivot table. As each investment number is chosen, the underlying pivot table cashflow data changes, allow the IRR function to pick up these cashflows and compute the IRR. However, if there are 500 investments, this becomes very time consuming - especially if the...

Add a specific Record to a Table based on a check box
I have a Table called ServiceTypes. Based on a User's input on a ProposalForm, ServiceTypes need to be added to a ProposalServicesTable. For instance, I have a Check Box on the ProposalForm. When a Check Box is clicked Yes, Access must search the ServiceTypes Table, select a specific ServiceTypeID, and add the ServiceType to the ProposalServicesTable. How can I add the proper Service record from the ServiceTable to the ProposalServicesTable based on the Check Box? I wouldn't do it that way. I'd use a listbox (with multi-select set to YES) that was sourced to the ServiceTab...

Converting XLS file to QIF or to OFX
How do I safely and securely convert an excel file (xls) to a QIF or OFX file? "dreamchaser" wrote: > How do I safely and securely convert an excel file (xls) to a QIF or OFX file? In Excel, save the file to CSV and ustilise iCreateOFX Basic from: http://icreateofx.co.uk/Convert-CSV-to-OFX to convert the saved CSV file to OFX. ...

lost data when opening excel workbooks ; text import wizard popup
When opening many of my excel files ,which all have the same modification date, I come across the text import wizard which states that my text in these files is 'delimited'. All of the files ,including a few word doc.s have had their data changed to show all " y " with two dots above the letter for as far as the eye can see. No import or export has been done with the files and no modifications were done on that date, as far as I know. Is this a corruption problem or is their some 'fix' that I am overlooking. Thanks for any ideas. ...

Saving a calculated field
First, yes I have read the threads on storing a calculated field and that it is bad mojo to do that. However, I have pay data that I calculate and input to a database and it must be able to be reconciled with our ADP data. So I need the ability to change and fix the data so it does not change as a result of recalculations. I have a form with a field that calculates the pay based on hours and pay rate. I have another field (the "copy" field) next to that one that has the control source set to the database field. I have set the default value of that field to be equal to the...

conversion lotus 123 files to excel -- problem
I am converting lotus123 files to excel2002. One problem is that in lotus, literals are ignored when found in a cell within a formula. Excel on the other hand is not doing this and therefore causing #value errors on all the formulas where this occurs. Is there a way to handle this in excel other than manually having to change all the formulas? ...

Wrapping text in a cell
In a single cell, suppose I want text to appear on two lines. Viz: Case One Case Two How do I do that so that I specify the wrap point? Thanks! If you are typing the data into the cell use Alt-Enter between each string to indicate where you want a line break to occur. Case One<Alt-Enter>Case Two Alt + Enter -- Lilliabeth ------------------------------------------------------------------------ Lilliabeth's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=27741 View this thread: http://www.excelforum.com/showthread.php?threadid=476428 If you...

Is it possible to highlight text?
I'd like to highlight just some of the text in a cell - not the entire thing. Thanks Select the cell and in the edit bar you can then select (highlight) some of the text with the mouse and format how you wish, eg bold, different colour, different background colour, different font/font size etc. Hope this helps. Pete This will NOT work in a formula. Works only if all text. -- Don Guillett SalesAid Software dguillett1@austin.rr.com "Pete_UK" <pashurst@auditel.net> wrote in message news:1139215455.134469.285660@z14g2000cwz.googlegroups.com... > Select the cell ...

Access, average several fields in one row
I have several rows of data in a field, I need to average all the entries in one row I have 12 fields for 12 months of data, I need the average of the sum of all non blank entries. For example 3 months completed, the solution in Excel is (field1+field2+field3)/3 I am looking for method to average the sum in Access One way if you can't change your data is to use a VBA function. I've posted one below. You would call it in a calculated field in a query. Assuming your field names are the abbreviated month names the expression might look like the following. Field: fRow...

Create interactive pivot table chart based on item selected
I'm trying to remember how to drag a chart object to the top left cell of a pivot table thus displaying a charted image of the detail item selected. Any suggestions? ...

How do I get excel files to open automatically from directories?
When I try to open excel files from the directory or from desktop I only get a blank worksheet not the file. I have to then go through File Open to get the file I want. There must be a way to have them open automatically. On Mon, 2 Jan 2006 21:22:01 -0800, Damian <Damian@discussions.microsoft.com> wrote: >When I try to open excel files from the directory or from desktop I only get >a blank worksheet not the file. I have to then go through File Open to get >the file I want. > >There must be a way to have them open automatically. Go to Tools -> Options -> Gen...

problem in changing the text of sentences before tables
I am developing a word automation application. In a method of mine, I change the text of some sentences of an opened word file, but the problem is when I change the text of a sentence which located before a table, it will be moved to the first cell of the table. My code is as follow: void myMethod( long startingSentenceNumber, const char *toBeSearched, const char *replacement, bool replace ) { Range currentSentenceRange; Selection sentenceSelection; Sentences sentencesList = m_document.GetSentences(); long sentencesCount = sentencesList.GetCount(); CString replacementCStr(...

reflecting values in a column into a row
I am creating a chart to map a round-robin chess game. If there are 4 players, then all 4 has to play one another. if I have the names John Mike Sally Bill Then I'd like to type them into a columns and write a formula in a row to pick up the names the spreadsheet should then look like this: John Mike Sally Bill John Mike Sally Bill I think it may be achieved with the Indirect() function, but my Excel 2007 help seems broken and I can't figure it out without an example. Thanks. MikeB With names in A2:A5 Enter in B1 =INDIRECT("A"&COLUMN(B1)) Or...

Odd problem with worksheets when opening file
Okay, here's the odd problem that's come up. When you double click on a excel file, excel opens up, but you can onl see the toolbars. The grid area looks like a snapshot of whatever you current background is before the file opened up. If you were showin your desktop, after the excel file opened, you'd still see your deskto in the datagrid area. If you start up a new excel file, then do the File>Open>file name, th file will open correctly. This problem happens across users here. Everyone is currently runnin office 2K. Any ideas on what causes the problem and any...

Outlook 2002 multiple file opening
In Outlook 2000, CTRL A would select all attached picture files, then Open would, in my case, open the files in Paintshop Pro. With the 2002 version I cannot find a way to do this. Any suggestions? ...

"File: send to mail recipient" not working
When users (on WinXP) select file, "send to mail recipient", no response from Outlook 2002. This occurs either when Outlook is open or closed. Problem happens when rt. clicking on .doc, .xls, .pdf's....all files. Any ideas?? Thanks!! ...

Microsoft CRM 1.2 database export failed 01-27-06
I am receiving this message when I try to upgrade my CRM 1.2 to CRM 3.0, does any one have any idea what this means? ...

need to make a formula that would add a field value to current dat
I have made a form in which I input different values. On of the values is (How Many Days). Now I need to a assign a default value, or expression (not sure which way to go about this) that will take the date value for (Date) and add the value (How Many Days) I figured that the formula should read =sum([Date]+[How Many Days]) But that is not giving me any results, thanx for your help in advance =DateDiff("d", Date(), [How Many Days]) -- Wayne Manchester, England. "J Man" wrote: > I have made a form in which I input different values. On of the values is ...

odd files created
Every time I open and edit an excel spreadsheet on a network share, small odd files get created. They are usually no larger than 25-40k and don't have any extensions to them. Looking at the properties page for any file, the file description says File. Anyone know what this is from or how to get rid of them? Permissions are setup correctly for me, Word files don't have this behavior. Excel 2000 SP3 Thanks, Hi Brian, A file the same size as the workbook would be created in the same directory as the workbook. The filename would be nonsensical (or appear to be random) character...

Evaluate Yes/No Field Based on User Input
Hi. I have a field that is set to Yes/No. I want to ask the user a question and based on their response (whether they type yes or no) I want the query to check the field and return all records marked yes is they type yes and all other records if they type no. How can I do this? Also, could I present them with a simple text box (having yes and no choices) or maybe a check box so they won't have to type anything? If you help me with the first part, this question is a bonus. I'll be happy with just the first question answered. Thanks! A Yes/No field actually stores -...

Export Format not avaiable
"The Format in which you are attempting to output the currentobject is not available." I hate access sometimes. It just get's weird, throwing bogus error messages all over the place. I have about 30 seperate queries that I run out to spreadsheets via macro. I have already found out that things can get all screwed up, (meaning it bombs) when those spreadsheets already exist, so the first thing I do is delete the existing spreadsheets, then let them rip. I run into this every once in a while: 20 or so queries into my macro, a query will fail with the above er...

Excel Template Wizard, Very Large File Size
Background: Excel 2000. I created a spreadsheet and used the template wizard that links to an Access 2000 database. The template was later used to create one record and saved as a spreadsheet. The database also contains this one record. Spreadsheet and database work fine. Later I reduced the Access field size properties (none are larger than 150, most are less than 50). There are 35 fields. Unexpected result: The Excel spreadsheet (template) and the linked Access database are huge. The spreadsheet is 35MB and the associated Access 2000 database is 24MB. Each contains one record (a si...

column value translation
I'm sorry if this is already here somewhere, but I could't find any references. I need to upload a list of people into our computer system and this list is comprised of their names and the code for the branch where they work. The computer system into which I need to upload this list will not recognize the current branch ID code for those employees, but I do have a list that is basically a comparison of the two different codes. For example branch code 800 on the list equals branch code C001 in the system. I need to get a way in excel to convert all the branch codes that are next...

html or plain text in email
Using MS Outlook 2000, when I want to reply to or forward an email, how do I get that reply or forward to be in html rather than plain text. When I create a new email it defaults to html, but when I reply or forward, it defaults to plain text. Thank you. using the forward or reply/all from menu the message will take on the config of the original sender. So the sender of the this message has txt as default editor. If you want to use your default (html) you will have to create new message and copy all text out of original past in your new message. Hope this helps. >-----Original ...

Fill cells with interpolated values
Hi What is the easiest way to fill cells with linear interpolated values ? e.g. i have value 5 in cell A1, and value 15 in cell A6. Cells A2 ... A5 should now be filles with 7, 9, 11, 13. of course, it's not a big deal to write a formula for interpolation, but maybe there is more simple way, (just by some mouse clicks....?) Biff Select the range A1:A6 with your start and stop value in their respective cells, and then do Edit / Fill / Series / Trend / Linear -- Regards Ken....................... Microsoft MVP - Excel Sys Spec - Win XP Pro / XL 97/00/02/...