Results 1 to 2 of 2
  1. #1
    Lounger
    Join Date
    Apr 2010
    Location
    Sofia
    Posts
    26
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Visible controls

    In my form the code for making controls visible and invisible does not work. My code is the following:
    Private Sub Form_Current()
    If Me![supplierid] = 1 Then
    Me.RaufGrade.Visible = False
    Me.RaufCode.Visible = False
    Me.AralGrade.Visible = True
    Me.AralCode.Visible = True
    ElseIf Me![supplierid] = 2 Then
    Me.AralGrade.Visible = False
    Me.AralCode.Visible = False
    Me.RaufGrade.Visible = True
    Me.RaufCode.Visible = True
    End If
    End Sub

    Why is it so? Is it because the form is continous? How can I make it work?

  2. #2
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts
    In a continuous form this code will be triggered by the value in whatever record is the current one.
    But if the controls become invisible, they will become invisible for all records, not just the current one.

    The only partial solution is to use Conditional Formatting. You can't use this to make things invisible, but you could change their colour.
    Regards
    John



Posting Permissions

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