I'm having an issue with security permissions. We have a folder "S:\Work Flow" with a folder for each employee. The front end and admin staff can see all the folders, but the employees only see their own folders. When a file is assigned to an employee by the front end staff, the code creates a folder with the file number in the relevant employee's workflow folder. So, for example, when file 154567 is assigned to JFenn in our access order sheet, it creates a folder "S:\Work Flow\JFenn\154567". This folder has the same permissions as its parent folder, which is to say that it is only visible to the front end, admin, and JFenn.
Sometimes, though, we need to change the employee to whom the file was assigned. So if the file is taken away from JFenn and assigned to JSmith, it would move (cut and paste, because there may be files in that folder already) the folder from "S:\Work Flow\JFenn\154567" to "S:\Work Flow\JSmith\154567". When I do this action manually using ctrl-x, the security permissions of the moved folder are changed so that JFenn is no longer allowed access, and JSmith is allowed access to this folder. When I make the change with VBA from Access, however, JFenn is the only employee with access to that folder still, only he can't see JSmith's folder. JSmith can't see the moved folder at all: it looks to him as though nothing has happened. I really don't want to have to do this change manually... can anyone help me? Here is the relevant bit of code.
Code:Private Sub AppraiserCB_AfterUpdate() Dim FSO As Object Dim FromPath As String Dim ToPath As String ToPath = "S:\Work Flow\" & FolderName(Me.AppraiserCB.Value) & "\" & Me.FileNumber FromPath = "S:\Work Flow\" & FolderName(Me.AppraiserCB.OldValue) & "\" & Me.FileNumber Set FSO = CreateObject("scripting.filesystemobject") If Me.AppraiserCB.OldValue <> 77 And FSO.folderexists(FromPath) = True Then If FSO.folderexists(ToPath) = True Then MsgBox "The system is trying to move all the data from the folder " & FromPath & " to the folder " & ToPath & ", but both folders already exist. You need to manually decide which folder to keep." Exit Sub End If FSO.movefolder Source:=FromPath, Destination:=ToPath Else If Dir(ToPath, vbDirectory) = "" Then MkDir ToPath End If DoCmd.RunCommand acCmdSaveRecord End Sub