Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2007

    Unanswered: File export at change in Cust?

    I am working with large text files.
    I have a request to break up 1 large text file into indiviudal files.

    My data example is, i have more fields, but in hopes of keeping it simple this is what i have.
    CustID, CustName.

    The large file currently has over 100 different CustID's. The request is to create a csv file at each change in the custID and to name the file "CustName".csv

    i was able to create VBA code to export to CSV at the click of a button, however it exports the whole table or the whole query, how could i create it creates a file per?

    export code...
    Private Sub Command19_Click()
    DoCmd.TransferText acExportDelim, , "qryMiffcoIncoming", "c:\my documents\\test_csv.csv"
    'Shell "excel.exe C:\test_csv.xls ", vbNormalFocus ' Opens Specified file
    End Sub

  2. #2
    Join Date
    Nov 2007
    Adelaide, South Australia
    Ummm... by using more than one line of code?!

    Seriously, I don't know where to start. Command19, the double backslashes in the filepath, the uselessly copied Shell command or processing records one by one.

    Homework assignment?
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!

    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

Posting Permissions

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