Results 1 to 4 of 4
  1. #1
    ItsJustMe3377 is offline Novice
    Windows 7 32bit Access 2013 32bit
    Join Date
    Oct 2017
    Posts
    4

    Can someone decode this code in layman's terms

    Good morning,

    Not very good at VBA just learning. I am wondering if someone could breakdown the code below and let me know what it is attempting to do.

    DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12Xml, myRs![Carrie_ID] & " - " & myRs![Client_Name], myRs![Orig_File_Drop_Path] & BillMonth & " " & myRs![File_Name], True




    Thank you. I am not putting something together and cannot make this run.

  2. #2
    JoeM is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    See here for an explanation on the TransferSpreadsheet action: https://msdn.microsoft.com/en-us/vba...-method-access

    So, if you break it down, you can see each argument:

    TransferType: acExport

    SpreadsheetType: acSpreadsheetTypeExcel12Xml

    TableName: myRs![Carrie_ID] & " - " & myRs![Client_Name]
    So it is looking for a table with the name that matches the calculation built (Carrie__ID field value plus a dash plus the Client_Name field value)

    FileName: myRs![Orig_File_Drop_Path] & BillMonth & " " & myRs![File_Name]
    Another calculation field, using the Orig_File_Drop_Path and File_Name values, as well as the value from the BillMonth variable

    HasFieldNames: True

  3. #3
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    when you type in : DoCmd.TransferSpreadsheet
    then hit spacebar, the command will show you all the arguments.

    query/table is the 3rd parameter.

  4. #4
    ItsJustMe3377 is offline Novice
    Windows 7 32bit Access 2013 32bit
    Join Date
    Oct 2017
    Posts
    4
    Thank you both so much for the quick response. It is much appreciated and helpful.

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

Similar Threads

  1. decode expression question
    By redhonda9834 in forum Queries
    Replies: 5
    Last Post: 11-24-2015, 10:13 AM
  2. Google Search Terms Needed
    By hrenee in forum Reports
    Replies: 4
    Last Post: 09-25-2013, 02:38 PM
  3. Replies: 9
    Last Post: 09-16-2012, 01:30 PM
  4. how to decode a string of numbers
    By cjlieber in forum Programming
    Replies: 4
    Last Post: 04-16-2012, 06:50 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