Results 1 to 2 of 2

Thread: How to check for control existence?

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2004
    Posts
    8

    Question How to check for control existence?

    I've got a form that builds a control array on a form, and later destroys some random controls from that array. Does anybody know how I can later check for the existence of a certain array member?

  2. #2
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,106
    If you access some property of a control that doesn't exist, I would expect that you would get an error. There may be a better way to do this, but one possibility would be to write a brief function that takes a control as an argument and returns a boolean. The function would reference the property, and catch any errors generated. If the error indicates that the control doesn't exist, return false, if no error occurs, return true.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width