Results 1 to 5 of 5

Thread: Loop question

  1. #1
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1

    Exclamation Unanswered: Loop question

    How can I use something like that in a loop


    Forms("F_Vaccation").lbl_1.BackColor


    so tha lbl_1 becomes lbl_2 , becomes lbl_3 ....

    I tried something like that but failed

    For i = 1 To 7 ' Number of Legend items
    Controls("leg" & i).BackColor = _
    Forms("F_Vaccation")."Clr_1" & i.BackColor
    Next

    Thank you

  2. #2
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    I could find it myself

    For i = 1 To 7 ' Number of Legend items
    Controls("leg" & i).BackColor = _
    Forms("F_Vaccation").Controls("clr_" & i).BackColor
    Next

    Sorry waisting your time

  3. #3
    Join Date
    Oct 2003
    Location
    Roanoke, Va
    Posts
    445

    Talking

    Originally posted by hammbakka
    I could find it myself

    For i = 1 To 7 ' Number of Legend items
    Controls("leg" & i).BackColor = _
    Forms("F_Vaccation").Controls("clr_" & i).BackColor
    Next

    Sorry waisting your time
    Glad we could help talk you through it.

    Gregg

  4. #4
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Quote Originally Posted by hammbakka
    I could find it myself

    For i = 1 To 7 ' Number of Legend items
    Controls("leg" & i).BackColor = _
    Forms("F_Vaccation").Controls("clr_" & i).BackColor
    Next

    Sorry waisting your time
    THANKS for the useful code Hammy!!!
    Back to Access ... ADO is not the way to go for speed ...

  5. #5
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    Quote Originally Posted by M Owen
    THANKS for the useful code Hammy!!!
    It's old one, glad to taht would be useful for you....

Posting Permissions

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