title: Passing Form Objects to VBA Subs/Functions in MS-Access
body: <p>I have a little multiple choice application. There are 4 green check marks and 4 red x's that will come up based on the right answer or the wrong answer. </p>
  
  <p>They are all not-visible initially and are in specific places on the form so that when they become visible, it'll be like a green check mark if they get it right next to their answer and a red check mark next to their answer if they get it wrong.</p>
  
  <p>I decided to make a sub-procedure that accepts three arguments, their answer ("A", "B", "C" or "D"), the green image reference to make visible and the red image reference to make visible.</p>
  
  <p>Unfortunately, I can't make them pass the references at all.  The intellisense knows what objects I'm referring to.</p>
  
  <pre><code>Private Sub btnA_Clicked ()
    Question_Answered("A", imgGreenA, imgRedA) 'images referenced from form'
  End Sub
  
  Private Sub Question_Answered (strUserAnswer as String, imgGreen as Image, imgRed as Image)
    ...
  End Sub
  </code></pre>
  
  <p>Another (probably related) problem is that I can't assign the images from the form to  local variables in that <code>Question_Answered</code> sub, like this:</p>
  
  <pre><code>Dim imgGreen as Image
  imgGreen = imgGreenA
  </code></pre>
  
  <p><em>Using MS-Access 2003 MDB with MS-Access 2007.</em></p>