Why does my comparator not work after first loop?
<p>I have a pretty simple <code>If Else</code> statement in my code that looks like this:</p>

<pre><code>If GUI.editedFH = "" Then
    fhNumField.Value = fhNumField.List(0)
Else
    fhNumField.Value = editedFH
End If 
</code></pre>

<p>This block of code is in a <code>UserForm_Initialize()</code> sub that I call fairly often after users use the form to edit or delete rows of data. I unload the form and reload it as a way to "refresh" the data presented in the form.</p>

<p>The code fails at the first line in that <code>If</code> statement. VBE throws this error </p>

<pre><code>Run-time error '1004':
Application-defined or object-defined error
</code></pre>

<p><code>GUI.editedFH</code> is a global string that is declared in a separate module. <code>GUI</code> is the name of the module, and <code>editedFH</code> is the string variable name. I put a watch on <code>GUI.editedFH</code> and I'm getting <code>String</code> as the type and the value that I want.</p>

<p>When I hardcode string values in, instead of <code>GUI.editedFH</code>, it still doesn't work i.e.</p>

<pre><code>If "abc" = "" Then
    '....
End If
</code></pre>

<p>The part that is most confusing is that I can compare strings like this elsewhere, and it is seemingly random on when the error will throw. It will work the first time through the initialize and a few subsequent times, but eventually it will throw an error.</p>