• On Format (Access 2000)

    Author
    Topic
    #441816

    In the OnFormat event in the Detal section of the report i have the following condition:

    Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    If Me!size = 205 Or 180 Then
    Me!grossprice.Visible = True
    End If
    End Sub

    However the grossprice is made visible in all cases,even when the size is not 180 or 205.Is there any remedy ?

    Viewing 0 reply threads
    Author
    Replies
    • #1061737

      Your condition is not correct, and you don’t set the Visible property to False for the other situation. Try

      Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
      If Me!size = 205 Or Me!size = 180 Then
      Me!grossprice.Visible = True
      Else
      Me!grossprice.Visible = False
      End If
      End Sub

      or, a bit shorter

      Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
      Me!grossprice.Visible = (Me!size = 205 Or Me!size = 180)
      End Sub

    Viewing 0 reply threads
    Reply To: On Format (Access 2000)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: