locked
code not runing CAN U PLEASE HELP I WANT MOVEFOLDER FROM REQUEST TO REQUESTCOMPLETE RRS feed

  • Question

  • Option Compare Database
    Function MoveRequestFolder()

    'MsgBox (Forms!frmWorkTracking!txtRevID & Forms!frmWorkTracking!txtFormNum)

    Dim reqPath As String
    Dim pathCheck As String
        
    reqPath = "\\execapps2\FIAOPPD\FIA Procedures\Online Policies and Document Production\Request"
    tarpath = "\\execapps2\FIAOPPD\FIA Procedures\Online Policies and Document Production\Request_Completed"

      '1. Validations
    'Check Form Number input



    ' Move Folder
    'Dim fdObj As Object
    Set fdObj = CreateObject("Scripting.FileSystemObject")
    ' if the destination folder doesn't Request_Completed, Create new folder path and move the request folder
    If Dir(desFolder, vbDirectory) = vbNullString Then
        fdObj.CreateFolder desFolder
        fdObj.MoveFolder reqPath & "\" & cboFolderName.Forms!frmWorkTracking!txtFormNum, "\" & txtNewFormId.Forms!Forms!frmWorkTracking!txtRevID & "_"
    ' else if the destination folder already exists, move folder directly
    Else
        fdObj.MoveFolder reqPath & "\" & cboFolderName.Forms!frmWorkTracking!txtFormNum, "\" & txtNewFormId.Forms!Forms!frmWorkTracking!txtRevID & "_"
    End If



      Application.Echo (False)
    DoCmd.Close acDefault
    Application.Echo (True)


      Exit Function



    End Function




     










    • Edited by skbah Tuesday, May 29, 2018 6:53 PM
    Tuesday, May 29, 2018 6:52 PM

All replies

  • Hello skbah,

    It's hard to troubleshoot your issue based on current limit information. I would confirm with you more details.

    What do you mean code not running? Did you get any error message? If so, what's the error messgae?

    Best Regards,

    Terry


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, May 30, 2018 10:09 AM
  • ok so the code suppose to move a folder from something call request to request completed but it not doing that if you could help i just want write a code to move a folder from a to b  vba access 
    Wednesday, May 30, 2018 2:35 PM
  • Hello skbah,

    What happened once you run the code? What do you mean code not running? Is it the whole code in your project?

    For the current code, I get an error at "If Dir(desFolder, vbDirectory) = vbNullString Then" since desFolder is empty.

    Did you get the same result?

    Best Regards,

    Terry


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, May 31, 2018 3:22 AM