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

    On Format (Access 2000)

    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 ?

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

    Re: On Format (Access 2000)

    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

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

    Re: On Format (Access 2000)

    Thank you, the code gives now the correct figures

Posting Permissions

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