title: Check permission of the directory in VBA Access before creating folder
body: <p>I'm trying to implement a certain feature in the Microsoft Access Database using VBA, so when a certain button is pressed, it will check first the availability of the folder in a server. If the folder doesn't exist, the corresponding folder will be created. However, the folders have permissions attached to them, which means only certain users can access it, and hence only certain users should create / access the folder. I have tried the following:</p>
  
  <pre><code>on error resume next
  If Dir("Server/Data/Celes", vbDirectory) = "Celes" Then
  Else
      MkDir ("Server/Data/Celes")
  End If
  </code></pre>
  
  <p>But I'm not sure if it's the best way to handle this problem. I use the "On Error Resume Next", so that if the error occurs due to the lack of permission to the folder (that already exists), it will ignore it. What are some better ways to handle this? Thank you.</p>
  
  <p>I also have checked the following links:</p>
  
  <ul>
  <li><a href="https://social.msdn.microsoft.com/Forums/office/en-US/a79054cb-52cf-48fd-955b-aa38fd18dc1f/vba-verify-if-user-has-permission-to-directory-before-saveas-attempt?forum=exceldev" rel="nofollow noreferrer">https://social.msdn.microsoft.com/Forums/office/en-US/a79054cb-52cf-48fd-955b-aa38fd18dc1f/vba-verify-if-user-has-permission-to-directory-before-saveas-attempt?forum=exceldev</a></li>
  <li><a href="https://stackoverflow.com/questions/27287485/check-folder-permissions-before-save-vba">Check Folder Permissions Before Save VBA</a></li>
  </ul>
  
  <p>but both of them concerns with saving the file, not creating folder.</p>