Solved

Need help creating CSV file with Access 2k

Posted on 2014-03-18
3
341 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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

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

10 Experts available now in Live!

Get 1:1 Help Now