title: Access label controls have different properties listed - how can I resolve this?
body: <p>I have a problem I believe is related to <a href="http://ewbi.blogs.com/develops/2003/10/access_cleartyp.html" rel="nofollow noreferrer">this problem</a>. I have many label controls. Some of them become "weird" and start exhibiting a weird "extra bold" display:</p>
  
  <p><img src="https://i.stack.imgur.com/CNZaY.png" alt="enter image description here"></p>
  
  <p>These labels have the same formatting but obviously have different visual representations.</p>
  
  <p>After looking into the properties for both labels, I noticed something quite strange: they have <em>different</em> properties. The broken label properties section actually is not showing the HyperLink properties nor the on-event actions. </p>
  
  <p><img src="https://i.stack.imgur.com/WFPNZ.png" alt="enter image description here"></p>
  
  <p>In fact, the "Events" properties sheet is actually empty when I go view it.
  <img src="https://i.stack.imgur.com/9LEUG.png" alt="enter image description here"></p>
  
  <p>I am quite confused what is going on here. I would like a way to fix these controls, preferably using VBA so I can add a programmatic fix to update all the broken labels.</p>
  
  <p>Much to my surprise, the following code works:</p>
  
  <pre><code>Application.Forms(gMananger_FormName).controls("Label13").HyperlinkAddress=""
  </code></pre>
  
  <p>I was expecting some sort of error since those labels do not show that control.</p>
  
  <p>I have also tried Compact/Repair to no avail. Nor did turning ClearType off in the Access options, as suggested in the link above.</p>
  
  <hr>
  
  <p>I have also written the following code to copy/add a new control but this breaks completely when controls are in tab spaces (it inserts a new line but doesn't delete the row, perhaps I could fix this if I spend more time, I'm concerned about accidentally deleting a ton of my form controls should I do this).</p>
  
  <pre><code>Sub testCopyingControl()
      Dim c
      Dim i As Integer, key
      Dim prop As Scripting.Dictionary
      Set prop = New Scripting.Dictionary
  
      Set c = Application.Forms(gMananger_FormName).Controls("Label3120")
  
  
      For i = 0 To c.Properties.count - 1
          prop.Add c.Properties(i).Name, c.Properties(i).value
      Next i
  
      Dim newC As Label
      Set newC = CreateControl(gMananger_FormName, acLabel)
  
      DeleteControl gMananger_FormName, c.Name
  
      'there are a fair number of readonly properties unfortunately...
      On Error Resume Next
      For Each key In prop.Keys
          Debug.Print key &amp; vbTab &amp; prop(key)
          newC.Properties(key) = prop(key)
      Next key
  
  
  End Sub
  </code></pre>
  
  <p>I can also fix this individually by cutting/pasting and moving the label back to its grid location. However this is a lot of work as I have quite a few controls doing this.</p>
  
  <ul>
  <li>How can I first fix a single label control exhibiting this behavior?</li>
  <li>How can I do this programatically via VBA?</li>
  </ul>