title: Check for valid connection between frontend and backend Access database
body: <p>I have an Access database application that I've split into a Frontend and Backend. The backend sits on a shared network drive that all users can access.  My issue is that when a user launches the frontend of this app, and they don't have a connection to the backend because the shared drive may not have been mounted locally, the initial form to be displayed when the app is launched, doesn't open and leaves the user questioning what's going on.  I already have code to check if the backend is connected although for some reason, when it isn't connected the intro screen form never is displayed and the access app just sits there</p>
  
  <pre><code>Private Sub Form_Open(Cancel As Integer)
      Dim strBackEndPath, LResult As String
      Dim i, j, lenPath As Integer
  
      'initialize variable status to 0
      Me.BEDB_Status = 0
      'define what to check in backend database
      strBackEndPath = CurrentDb.TableDefs("VersionInfo-Available").Connect
  
      ' Now remove the datebase  &amp; password prefix
      j = InStrRev(strBackEndPath, "=") + 1
      strBackEndPath = Mid(strBackEndPath, j)
  
      'Checking access to Backend database files...
      Me.MessageText = "Checking access to Backend database files..."
      On Error Resume Next
      LResult = Dir(strBackEndPath)
      'Set status to Length of LResult
      Me.BEDB_Status = Len(LResult)
  
      'Check length of BEDB_Status, if greater than 0, backend is connected. If 0, backend is not connected.
      If Me.BEDB_Status &gt; 0 Then
          'length is greater than 0 so continue opening the app
          DoCmd.OpenForm "IntroScreen"
      Else
          'length is 0 so backend is not connected. Alert user and quit the app
          Me.MessageText = "The database isn't currently accessible. Program will now exit. Please ask the support team for assistance"
          DoCmd.Quit acQuitSaveNone
      End If
  
  End Sub
  </code></pre>