[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 384
  • Last Modified:

Need help creating CSV file with Access 2k

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
pcalabria
Asked:
pcalabria
  • 2
2 Solutions
 
rspahitzCommented:
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
 
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
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
 
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now