Results 1 to 2 of 2

Thread: Array usage

  1. #1
    Join Date
    Apr 2004

    Unanswered: Array usage

    I'm trying (unsuccessfully) to use a string array during a loop statement. My goal is to validate a group of textboxes while leaving a few others out of the validation loop. I want to avoid validating two textboxes with the names of txtAccountingID and GrantDuration. I would really like to use an array to represent the list of textboxes I don't want to validate.

    My problem seems to lie in the For statement - Ctrl.Name <> TextBoxName() - see code below

    Can anyone guide me on how to use an array to represent a list of names?

    Dim Ctrl As Control
    Dim RedInt As Integer
    Dim TextBoxName(1) As String
    RedInt = 0
    TextBoxName(0) = "txtAccountingID"
    TextBoxName(1) = "GrantDuration"

    For Each Ctrl In Controls
    If TypeOf Ctrl Is TextBox And Ctrl.Name <> TextBoxName() Then

    ... remainder of code works...

    Thank you in advance for any help

  2. #2
    Join Date
    Jun 2004
    Arizona, USA
    What about this...
    "Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
    "I have my standards. They may be low, but I have them!" - Bette Middler
    "It's a book about a Spanish guy named Manual. You should read it." - Dilbert

Posting Permissions

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