Results 1 to 4 of 4
  1. #1
    charly.csh is offline Competent Performer
    Windows 8 Access 2007
    Join Date
    Nov 2014
    Posts
    186

    Attachment button..... need some help with a part of my code

    Hello everyone,



    I've created an attachment button and it goes to an specific folder

    the only concern I have is that I do not know how to get the "new location path with the file name also included"

    See code below:


    Dim sourceFolder As String, destinationFolder As String
    Dim aFSO As Object
    Dim Direccion As String
    Dim Destination As String


    Direccion = Me.Problemsupporttxt


    sourceFolder = Direccion


    destinationFolder = "C:\Users\General\Desktop\A3_Problem_Solving_Tool\ " & Me.Code_ID + "\"


    Set aFSO = CreateObject("Scripting.FileSystemObject")


    aFSO.CopyFile sourceFolder, destinationFolder


    it works pretty good!, just I would like to have into a second textbox named "ProblemSupport2txt" (into my form) the new location with also the file name included.... I mean something like this example


    Me.ProblemSupport2txt = C:\Users\General\Desktop\A3_Problem_Solving_Tool\A-20151209-001\DocumentName.xlsx"


    Thanks for the help!!!!!

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    Me.ProblemSupport2txt = destinationFolder & "DocumentName.xlsx"
    or
    Me.ProblemSupport2txt = destinationFolder & Mid(Direccion, InStrRev(Direccion, "\") + 1)

  3. #3
    charly.csh is offline Competent Performer
    Windows 8 Access 2007
    Join Date
    Nov 2014
    Posts
    186
    Thank you!!! the second option was the one!!

  4. #4
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    You are welcome

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

Similar Threads

  1. Replies: 7
    Last Post: 08-18-2015, 08:05 AM
  2. Replies: 3
    Last Post: 10-20-2014, 03:25 PM
  3. Replies: 17
    Last Post: 11-05-2013, 04:19 AM
  4. Last Part of code not working
    By mejia.j88 in forum Programming
    Replies: 19
    Last Post: 02-22-2012, 12:36 PM
  5. Button to duplicate part of record
    By jbickl in forum Forms
    Replies: 3
    Last Post: 02-08-2012, 10:44 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