Page 1 of 2 12 LastLast
Results 1 to 15 of 23
  1. #1
    kwooten is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2011
    Posts
    255

    TransferText to export 3 queries to csv

    I am using Access 2016 and am having a hard time making a csv export specName (manually export the query, click ADVANCED in bottom left corner, setup your spec, save), I do not see this advanced option. I have 3 files that are similar (ResponsibleManager_1, ResponsibleManager_2 and ResponsibleManager_3) and need some code to run all 3 to CSV so I can stop exporting each individually and manually adjusting.



    Can someone please help me with this DoCmd.TransferText?
    Attached Files Attached Files

  2. #2
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Right-click on your query, select Export to Text. That should give the Advanced button.

  3. #3
    kwooten is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2011
    Posts
    255
    Quote Originally Posted by aytee111 View Post
    Right-click on your query, select Export to Text. That should give the Advanced button.
    It doesn't.. this is the screen I get when I do that

    Click image for larger version. 

Name:	ExportText.PNG 
Views:	14 
Size:	38.5 KB 
ID:	30924

  4. #4
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Go one step further - click on OK.

  5. #5
    kwooten is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2011
    Posts
    255
    still nothing

    Click image for larger version. 

Name:	NextStep.PNG 
Views:	14 
Size:	8.0 KB 
ID:	30926

  6. #6
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Never seen that before, maybe you have encoding set to yes. What happens when you click OK on that window?

  7. #7
    kwooten is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2011
    Posts
    255
    Access exports the file..

    where would I change this setting?

  8. #8
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    I get the export wizard when I click on the ok from post #3. I wonder if you don't have the wizards installed, or if this is a 2016 thing. You can also create specifications when you import a file. Try that and see if the wizard comes up.

  9. #9
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Here are some people discussing the problem. It may require an Office repair or an uninstall of a Windows update.
    https://answers.microsoft.com/en-us/...7-78f5e9cfde6b

  10. #10
    kwooten is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2011
    Posts
    255
    not sure what happened but it is working now


    Click image for larger version. 

Name:	Spec.PNG 
Views:	11 
Size:	47.1 KB 
ID:	30927

  11. #11
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Great! Saved you lots of trouble.

  12. #12
    kwooten is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2011
    Posts
    255
    yes.. now trying to get my code to work.. "Cannot update. Database or object is read-only"

    Code:
    Option Compare Database
    
    Private Sub ExportResponsibleManager()
     
        Dim i As Integer
        Dim myQueryName As String
        Dim myExportFileName As String
     
        For i = 1 To 3
            myQueryName = "ResponsibleManager_" & Format(i, "1")
            myExportFileName = "H:\Ariba\Ad_Hoc\ResponsibleManager_" & Format(i, "1") & ".csv"
            DoCmd.TransferText transferType:=acExportDelim, SpecificationName:="ExportCSV_RM" & Format(i, "1"), TableName:="ResponsibleManager_" & Format(i, "1"), FileName:="H:\Ariba\Ad_Hoc", hasfieldnames:=True
        Next i
     
    End Sub

  13. #13
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    More information needed. Which line is it occurring on? Is it on the first file? Did you complete post #10 and get the file written to that file in that folder?

  14. #14
    kwooten is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2011
    Posts
    255
    duplicate post

  15. #15
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Maybe because there is no file name in the command, only a path.

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Two queries, export to Excel.
    By JumpyJim in forum Queries
    Replies: 4
    Last Post: 09-15-2017, 10:47 AM
  2. Export crosstab queries
    By sk88 in forum Queries
    Replies: 4
    Last Post: 03-02-2015, 03:53 PM
  3. Replies: 2
    Last Post: 05-29-2014, 09:30 PM
  4. Replies: 7
    Last Post: 01-08-2014, 10:36 AM
  5. Replies: 1
    Last Post: 03-25-2010, 03:12 PM

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