title: Why does my Access database keep crashing?
body: <p>I was happily creating an Access Database in MS Access 2007 and I recently created a simple logon and splash screen form. Now, everytime i try to enter a string into my textbox, the program keeps crashing.</p>
  
  <p>Error message says: Microsoft Access has stopped working. Windows can try and recover your data.</p>
  
  <p>Remedial Actions Taken:</p>
  
  <ol>
  <li>I tried the 'Compact &amp; Repair Database' option. (no good)</li>
  <li>I tried to delete the logon and splash screens (crashes)</li>
  <li>I trield Alt+F11 to access the VB code (crashes again)</li>
  </ol>
  
  <p>Below is the simple VB code i inserted at the start:</p>
  
  <pre><code>Option Compare Database
  
  Public intlogonattempts As Integer
  
  Private Sub cmdOK_Click()
  'Check to see if data is entered into the password box
  If IsNull(Me.txtPassword) Or Me.txtPassword = "" Then
      MsgBox "You must enter a Password.", vbOKOnly, "Required Data"
      Me.txtPassword.SetFocus
      Exit Sub
  End If
  
   'Check value of password in tblEmployees to see if this
      'matches value chosen in combo box
  
      If Me.txtPassword.Value = "password" Then
  
          DoCmd.Close acForm, "frmLogon", acSaveNo
          DoCmd.OpenForm "frmSplash_Screen"
  
      Else
        MsgBox "Password Invalid. Please Try Again", vbOKOnly, _
              "Invalid Entry!"
          Me.txtPassword.SetFocus
      End If
  
      'If User Enters incorrect password 3 times database will shutdown
  
      intlogonattempts = intlogonattempts + 1
      If intlogonattempts &gt; 3 Then
        MsgBox "You do not have access to this database.Please contact admin.", _
                 vbCritical, "Restricted Access!"
          Application.Quit
      End If
  End Sub
  </code></pre>
  
  <p>Is there anything underlying here that is affecting/corrupting the program?</p>
  
  <p>thanks</p>