Results 1 to 3 of 3

Thread: Variable Question......

  1. #1

    Thread Starter
    Addicted Member Smie's Avatar
    Join Date
    Jun 1999
    Location
    Columbus, OH
    Posts
    249

    Post

    I have set controll textboxes, eg.

    DAY(0).text = "Hello"
    DAY(1).text = "Hello"
    DAY(2).text = "Hello"
    and so on..........

    Is there a way I can take the entire DAY and instead of having to put all the extra lines of code, just use one line to represent all the DAY s? Like having

    DAY.text = "Hello"

    and all the Day.texts change?
    I appreciate any help. Thanks

  2. #2
    Guru Aaron Young's Avatar
    Join Date
    Jun 1999
    Location
    Red Wing, MN, USA
    Posts
    2,177

    Post

    You could use a FOR.. EACH Loop, ie.
    Code:
    Private Sub Command1_Click()
        For Each TextBox In txtDay
            TextBox.Text = "Hello"
        Next
    End Sub
    This would set the Text Property of all the Textboxes in the txtDay Control Array to "Hello".


    ------------------
    Aaron Young
    Analyst Programmer
    [email protected]
    [email protected]


  3. #3

    Thread Starter
    Addicted Member Smie's Avatar
    Join Date
    Jun 1999
    Location
    Columbus, OH
    Posts
    249

    Post

    thanks Aaron!

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