title: Trouble passing form to module in VBA
body: <p>I have a click event on a form in Access 2010 that looks like so:</p>
  
  <pre><code>Private Sub SaveRecord_Click()
       checkDataIntegrity(Me)
  End Sub
  </code></pre>
  
  <p>Where <code>checkDataIntegrity</code> is defined as follows:</p>
  
  <pre><code>Function checkDataIntegrity(ByVal fForm As form) As Boolean
  </code></pre>
  
  <p>This works fine and dandy.  However, I have another click event:</p>
  
  <pre><code>Private Sub LFS_Flashed_Successfully_Fail_Click()
       preventSimultaneousPassAndFail (Me)
  End Sub
  </code></pre>
  
  <p>Where <code>preventSimultaneousPassAndFail</code> is defined as follows:</p>
  
  <pre><code>Function preventSimultaneousPassAndFail(ByVal fForm As form) As Boolean
  </code></pre>
  
  <p>When I invoke this click event I get the following error:</p>
  
  <pre><code>Run-time error '13':
  Type mismatch
  </code></pre>
  
  <p>What am I doing wrong here?  Both event calls are invoked in the same form and call functions in the same module.</p>