Solved

Need help creating CSV file with Access 2k

Posted on 2014-03-18
3
347 Views
Last Modified: 2014-07-03
I am using Access 2K on Windows XP Professional platform.

I am trying to create a CSV file so I can export information from my database to eBay.
The CSV file must pull the information about the parts I want to sell from my database.  In addition, the CSV file must contain addition fields, which will be constant for each record in the csv file.

For example, each record should have a field named ACTION, which must be set to ADD or VERIFYADD.

To do this, I created a form with a combo box named ACTION, and the combo box allows me to select either word.

Next, I build a select query that pulls info from my database in addition to the ACTION combo box using the format  [Forms]![frmEbayCreateTemplate]![Action] AS [Action].

The query appears to work.  By this I mean it looks exactly as you would expect, except that when I attempt to export it to a csv file I get an error message.

Unable to import into a csv file, I tried to copy and paste the data from the query into an excel spread sheet, and the columns with data, such as the ACTION column, did not paste into the spreadsheet.  In other words, all the data pulled from the database pasted fine, but all the data pulled from the form was blank, even though it appeared to look normal in the query.

Any ideas why I can't create a csv file or copy the data?
0
Comment
Question by:pcalabria
  • 2
3 Comments
 
LVL 22

Accepted Solution

by:
rspahitz earned 250 total points
ID: 39937810
I'm not exactly sure what the problem is.
What is the error message?
And copying a form from Access to Excel rarely works directly.

Did you add a button to the form and run the wizard to let it export the data?  If not (or if it's not available) then it would be relatively easy to create some VBA to handle creating the CSV file if you want to go in that direction.
0
 
LVL 84

Assisted Solution

by:Scott McDaniel (Microsoft Access MVP - EE MVE )
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 250 total points
ID: 39947337
Often the simplest thing to do is create a temporary table with the exact columns you need, and then fill and export that table. For example, if I have a table named "tmpCSV", then I'd do this:

With Currentdb
  .Execute "DELETE * FROM tmpCSV"
  .Execute "INSERT INTO tmpCSV(Col1, Col2, Col3) (SELECT Field1, Field2, Field3 FROM SomeTable"
End With

Now create a form that is based on tmpCSV and use that form to make edits.

When you're finished making edits, save the data and then do the transfer:

If Me.Dirty Then Me.Dirty = False
DoCmd.TransferText etc etc
OR
DoCmd.TransferSpreadhseet etc etc

Not sure if TransferText or TransferSpreadsheet would work better, so try each and see which one provides the right output.
0
 
LVL 84
ID: 40174209
Why a B grade with no request for additional help? EE policy requires you to ask for additional help before awarding a grade lower than A:

http://support.experts-exchange.com/customer/portal/articles/481419
0

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

735 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