Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Sep 2006
    Posts
    166
    Thanks
    0
    Thanked 0 Times in 0 Posts

    for each code (Access 2000)

    i have 10 labels called Lbl1,Lbl2, etc. I want to build a command making the labels visible and invisible using the " for each " construction. How can i do that ?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: for each code (Access 2000)

    Like this:

    Sub ShowLabels(f As Boolean)
    Dim i As Integer

    For i = 1 To 10 ' change to number of labels
    Me.Controls("Lbl" & i).Visible = f
    Next i
    End Sub

    Use like this to make the labels visible:

    ShowLabels True

    and like this to hide them:

    ShowLabels False

  3. #3
    2 Star Lounger
    Join Date
    Sep 2006
    Posts
    166
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: for each code (Access 2000)

    It just works fine.Thank 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
  •