Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2003

    Unanswered: Dynamic Text Box and Label

    Here is what I would like to do.

    I have 5 text boxs and labels, so we will just work with the labels for now. As the the same code kind of applies to both.

    text1, text2, text3, text4, text5.

    I would like a for loop to be able to alter their captions, so...

    For X=1 to 5
    text(X).caption = "looky here"
    Next X

    I know this isn't right, but you get the picture. Is there a way to accomplish what I am trying to do?

    Thanks for any help.
    Life's a bowl of punch, go ahead and spike it.

  2. #2
    Join Date
    Feb 2003
    Auckland, NZ
    Try the following

    For X=1 to 5

    me.controls("Label" & X).caption = "lable caption" 'For the lable
    me.controls("Text" & X) = "Text" 'For the textbox



    me.controls can be replaced with

    JJ Kennedy
    Double J IT Solutions

    VB 6, VB.NET, ASP.NET, MS SQL Server, MySQL, MS Access

  3. #3
    Join Date
    Jul 2003
    Worked like a charm, thank you.
    Life's a bowl of punch, go ahead and spike it.

Posting Permissions

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