title: How to reference a textbox from another form?
body: <p>I'm trying to modify existing code to add a popup box. This popup box is another form, and when a user clicks on a button on this form, I want a textbox on the base form to be populated.  After that the popup disappears and then I need to access that value from the textbox on the base form.</p>
  <p>The sequence should be:</p>
  <ol>
  <li>Base form button click calls modal popup</li>
  <li>Click in button on popup saves value to base form's textbox, then returns control.</li>
  <li>Base form then uses this value to do something.</li>
  </ol>
  <p>Base Form</p>
  <pre class="lang-vb prettyprint-override"><code>Sub base()
      DoCmd.OpenForm &quot;PaperType&quot;, , , , , acDialog
      
      MsgBox Me.TheAnswer           'This line gives a null error
  End Sub
  </code></pre>
  <p>Popup Form</p>
  <pre class="lang-vb prettyprint-override"><code>Private Sub btnRolls_Click()
      'Me.Tag = 1
      Forms!ReceiptDetail_sfrm!TheAnswer = 1
      Me.Visible = False
  End Sub
      
  Private Sub btnSheets_Click()
      'Me.Tag = 4
      Forms!(&quot;ReceiptDetail_sfrm&quot;).TheAnswer = 4
      Me.Visible = False
  End Sub
  </code></pre>