title: Cannot reference to a form control which is out of focus
body: <p>This is a follow up to a <a href="https://stackoverflow.com/questions/11986227/update-textbox-during-typing">previous question</a> I asked about how to update a textbox while typing. In my previous question, I had three textboxes, two of which were enabled and one which was not. They look like this:</p>
  
  <p><img src="https://i.stack.imgur.com/QKWO2.jpg" alt="Three textbox image"></p>
  
  <p>My goal is to use the First and Last Name of the two textboxes to fill a "Code Personal" in the other textbox. As I type the first and last names, I want the Code Personal textbox to update immediately, with the format of <strong>LLLLLL_F</strong> (eg: BERNAS_P). However, whenever I try to update the Code Personal textbox, I receive this error:</p>
  
  <p><img src="https://i.stack.imgur.com/5DhVz.jpg" alt="Error image"></p>
  
  <p>The code I use to create the Code Personal format and to update the textbox is:</p>
  
  <pre><code>Private Sub TxtFName_Change()
  
  firstName = Me.TxtFName.Value
  lastName = Me.txtLName.Value
  firstPart = Left(lastName, 6)
  secondPart = Left(firstName, 1)
  
  nameCode = firstPart + "_" + secondPart
  upperNameCode = UCase(nameCode)
  
  txtCodePersonal.Text = upperNameCode 'My debug tells me I have an error here
  End Sub
  </code></pre>
  
  <p>I've tried to set the focus to the <em>txtCodePersonal</em> textbox through: <code>[txtCodePersonal].SetFocus</code>, but I still receive an error (MS Access can't move the focus to the control <em>txtCodePersonal</em>.)</p>
  
  <p>Any Ideas as to how I can update the "Code Personal" textbox while typing in the other two textboxes?</p>
  
  <p>Thanks in advance for all your help. </p>