Solved

Need help creating CSV file with Access 2k

Posted on 2014-03-18
3
346 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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
On Key Down Access 2010 6 41
Import MySQL data into MS Access using VB.Net interface 5 29
set focus to tabbed sub form 10 39
too few parameters , expected 3 14 12
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…
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…
Familiarize people with the process of utilizing SQL Server functions 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 Microsoft Ac…
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…

860 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