Solved

Need help creating CSV file with Access 2k

Posted on 2014-03-18
3
361 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
[X]
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
  • 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 85

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 85
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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
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…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

729 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