Results 1 to 2 of 2
  1. #1
    3 Star Lounger
    Join Date
    Jul 2001
    Posts
    280
    Thanks
    0
    Thanked 0 Times in 0 Posts

    how to hide blank fields (Access 2000)

    How to show only Discounts that are not o%

    I have a field in the report called "Discount" showing the disount from the unit price.Some of the goods have no discount and therefore in displaying the result the disount is shown as 0 %. In this case i
    want that the 0% are not visible, and to show the discount only if it
    is available.I have tried the following code in the OnOpen event of the report
    If Me![Discount].Value = 0 then
    Me![Discount].Visible = false

    However i receive the following error:

    Runtime error 2427 You entered an expression that has no value

    I have tried also in the OnFormat event of the Detail section but with the same result.
    How can i receive blanks for the results when i have 0% discount?

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: how to hide blank fields (Access 2000)

    Markus,

    You have to place your code in the On Format event of Detail of you report.
    Don't forget to set it to True in other cases then 0%
    <pre>Private Sub Detail1_Format(Cancel As Integer, FormatCount As Integer)
    If Me!Discount = 0 Then
    Me!Discount.Visible = False
    Else
    Me!Discount.Visible = True
    End If
    End Sub
    </pre>

    Success
    Francois

Posting Permissions

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