title: How to reference a subform in MS Access
body: <p>In my MS Access application, I am using a form which contains only two controls - a textbox and a command button. This form is named as <code>HEADER FORM</code>. </p>
  
  <p><code>HEADER FORM</code> is used as a subform in header section of various other forms. </p>
  
  <p>What I want to do is that whenever a particular form loads, I want to fill details in the textbox of the <code>HEADER FORM</code> (that will be name of the person who has logged in. The same would be clear from the picture below). </p>
  
  <p>I am trying to call a global subroutine named <code>updateHeader</code> in form load event of all the forms. </p>
  
  <pre><code>Public Sub updateHeader()
      Me![HEADER FORM].Form.txtHeaderName.Value = strPerson
  End Sub
  </code></pre>
  
  <p>Following is the picture showing <code>HEADER FORM</code> in Design View and the same being used as a subform in a login form.</p>
  
  <p><img src="https://i.stack.imgur.com/6b22R.png" alt="enter image description here"></p>
  
  <p>I tried various other options but am not able to come out with the correct way to reference the form. Am I doing something wrong fundamentally?</p>
  
  <p>The error that I am seeing is invalid use of <code>Me</code> keyword. 
  Also, my <code>updateHeader</code> subroutine is a global subroutin which is called from Form_Load event of all the forms. </p>