title: Access VBA: Passing Form/Subform name to a Function?
body: <p>I am attempting to pass a form/subform name to a function without success.  The function steps thru each .Control on the subform and performs a simple set of look-ups &amp; actions.  My code works as expected with the Form/Subform name hard coded; I am looking for a more generic approach.</p>
  
  <p>Getting a type mismatch error on the function call, with and without quotes.</p>
  
  <p>Example:</p>
  
  <pre><code>'Function Call
    call AuditChanges("forms![someForm]![someSubForm]")
  
  'Audit Function
  Sub AuditChanges(thisForm as form)
      Dim ctl As Control
      Dim strTest as string
  
      For each ctl in thisForm.controls
          strTest = ctl.Value
          'do some stuff
      Next ctl
  
  end sub
  </code></pre>
  
  <p>Any suggestions for proper syntax to pass the form/subform info?</p>
  
  <p>Thanks!</p>