title: Access vba Check if file exists
body: <p>I have a database split in FrontEnd and BackEnd.</p>
  
  <p>I have it running:
  i) in my office
  ii) updating/testing in my personal computer.</p>
  
  <p>My BackEnd file is running in different Folder location according to computer running.</p>
  
  <p>I want to place a code and check if file exist.</p>
  
  <p>Code:</p>
  
  <pre><code>Sub FileExists()
  Dim strPath As String   '&lt;== Office.
  Dim strApplicationFolder As String
  Dim strPathAdmin As String   '&lt;== Admin.
  
  strPath = "\\iMac\Temp\"
  strApplicationFolder = Application.CurrentProject.Path
  strPathAdmin = strApplicationFolder &amp; "\Temp\"
  
  If Dir(strApplicationFolder &amp; "SerialKey.txt") = "" Then
  '===&gt; Admin User.
      If Dir(strPathAdmin &amp; "*.*") = "" Then
          '===&gt; Empty Folder.
      Else
          '===&gt; Files on folder.
      End If
  Else
      '===&gt; Office User.
      If Dir(strPath &amp; "*.*") = "" Then
          '===&gt; Empty Folder.
      Else
          '===&gt; Files on folder.
      End If
  End If
  End Sub()
  </code></pre>
  
  <p>I have this until now.</p>
  
  <p>Any help.</p>
  
  <p>Thank you...</p>