Results 1 to 4 of 4
  1. #1
    Susy is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Sep 2014
    Posts
    134

    Create a csv export from data shown in a subform (table like) from a form. VBA ist welcome!

    Hi guys,

    is there a way to filter data from a subform (in a form) and create a regular csv file (UTF-8, comma delimited...) with the data filtered, meaning if I want to export 10 records out of 1000 then I just filter them and export them.

    Creating the file directly from a table is done, but the above is appearing to be impossible.

    This is the code I use to export my table to a csv file.
    Code:
    DoCmd.TransferText acExportDelim, "mySpecs", "tbl_toExport", pathname, True, , 65001
    Any ideas?

    Regards,

    Susy

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    make query, qsSubData, that pulls data from the table needed and filters via the ID on the main form.
    select * from table where ID = forms!frmMain!txtID

    THIS is the data for the sub form (not a table)
    then just export the query

    DoCmd.TransferText acExportDelim, "mySpecs", "qsSubData", pathname, True, , 65001

  3. #3
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2013 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Not a lot of details. How are you exporting from the subform, is it a command button? How are you filtering, right-click?

    If those are both true, then you can export using "Me.Filter" which contains your filtering specifications.

  4. #4
    Susy is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Sep 2014
    Posts
    134
    Hi guys,

    thanks!

    At the end what I did was to create two cboxes in my form (between ### and ###) to use in a query. And voila, I can create my .csv export.

    What I wanted to to do was something different...
    1. in the form and created a subform with a table with all the data
    2. once there, I wanted to just select (rows) the rows I need for the export (.csv)

    Unfortunately, I did not know how to do that!

    Thanks for your support.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Requering the subform shown on main form
    By vazdajic in forum Forms
    Replies: 8
    Last Post: 02-29-2016, 12:06 AM
  2. Export to xml: Table is shown twice
    By Nina07 in forum Import/Export Data
    Replies: 3
    Last Post: 04-10-2015, 10:13 AM
  3. Replies: 3
    Last Post: 01-25-2015, 12:09 PM
  4. Replies: 5
    Last Post: 04-04-2014, 03:33 PM
  5. Data entered into form is not shown in Table
    By engr_saud1 in forum Forms
    Replies: 5
    Last Post: 04-07-2013, 06:34 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums