Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2006
    Posts
    157

    Unanswered: Export Data into textfile thru VBA code

    Hi:
    Can any one please tell me how to i export data thru VBA code as same when i right click on any table and then it ask me to export data as comma delimited. Can i do the same thru VBA code. I need it not prompt me for comma delimited or fixed length as i only need the comma delimited text. It automatically convert the table into comma delimited text.

    Thanks.

  2. #2
    Join Date
    Feb 2004
    Location
    Chicago, IL
    Posts
    1,312
    First, export the file the way you do, but when the wizard comes up choose the Advanced button. This will allow you to create a File Specification. Once you have chosen all of your options (comma separated, date format, field names, etc.) save the file specification with an appropriate name.

    Then in VBA you can use the DoCmd.TransferText method to do the export. The parameters for this function can be a little confusing, so I always recommend using the Macro editor to test your export, then once you have the macro working you copy and paste the parameters into you VBA function call. With the macro editor the combo boxes and other screen hints help to put the right data in the right fields.

  3. #3
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    yup that's work

    you could also be masochistic and do it by writing to text files (use write #x. but thats really appropriate for old timers like me who remeber the 'googd old days' of standard Basic
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •