Code in Sub doesn't recognize label on form

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • shingabiss
    New Member
    • Oct 2006
    • 15

    Code in Sub doesn't recognize label on form

    This is an odd one; I have a form with the usual text boxes, labels and command buttons on it. There is one label, whose name I have changed several times as an attempt to make it be recognized in the code. This is VB6 and has the auto-property "suggestion " dropdown after entering the period after the control's name. This occurs with every other object when addressing them in a sub except for this one, named DatafileName (changed it several times). I have compared the properties to another label and can't see any differences except location coords. It's not part of a label array. I'm stumped. D'ohh!!

    In a nutshell:
    Why does the form accept the name as valid for the label yet the code not recognize it?
  • willakawill
    Top Contributor
    • Oct 2006
    • 1646

    #2
    Originally posted by shingabiss
    This is an odd one; I have a form with the usual text boxes, labels and command buttons on it. There is one label, whose name I have changed several times as an attempt to make it be recognized in the code. This is VB6 and has the auto-property "suggestion " dropdown after entering the period after the control's name. This occurs with every other object when addressing them in a sub except for this one, named DatafileName (changed it several times). I have compared the properties to another label and can't see any differences except location coords. It's not part of a label array. I'm stumped. D'ohh!!

    In a nutshell:
    Why does the form accept the name as valid for the label yet the code not recognize it?
    Hi, would you kindly post the offending code?

    Comment

    • shingabiss
      New Member
      • Oct 2006
      • 15

      #3
      Originally posted by shingabiss
      This is an odd one; I have a form with the usual text boxes, labels and command buttons on it. There is one label, whose name I have changed several times as an attempt to make it be recognized in the code. This is VB6 and has the auto-property "suggestion " dropdown after entering the period after the control's name. This occurs with every other object when addressing them in a sub except for this one, named DatafileName (changed it several times). I have compared the properties to another label and can't see any differences except location coords. It's not part of a label array. I'm stumped. D'ohh!!

      In a nutshell:
      Why does the form accept the name as valid for the label yet the code not recognize it?
      I just figured it out! I have declared a variable with the same name as the label and didn't realize it. I guess the variable name tool precedence and didn't have, of course, properties.

      Thanks for the reply.

      Comment

      Working...