Results 1 to 9 of 9
  1. #1
    5 Star Lounger
    Join Date
    Jan 2005
    Posts
    614
    Thanks
    0
    Thanked 0 Times in 0 Posts

    No data - show dashes (Access2000-03)

    Thanks to your help my Report is almost done and ready to go.
    However last request from a client was is to have labels for SUB Reports displayed even if there is no data.
    They want to see dash in place where there is no data.
    I had tried
    If SUBReport1.Visible = False Then Label1.Visible = True but doesn't work.

    I had tried to insert =IIf(IsNull([NA_Total]),"-",([NA_Total])) into Data Source of the field but I get #ERROR

    There is No_Data event but I do not know how to use it.

    Please, help

    P.S. I can insert labels next to the SUB Label that displays name and have it like
    If SUBReport1.Visible = False Then Label1.Visible = true

    I think it is the easiest. But anything goes...

    Thanks

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

    Re: No data - show dashes (Access2000-03)

    The solution you mention in your PS is by far the easiest.

  3. #3
    5 Star Lounger
    Join Date
    Jan 2005
    Posts
    614
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: No data - show dashes (Access2000-03)

    WOW! What event it should be placed on? Thanks

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

    Re: No data - show dashes (Access2000-03)

    The same event where you make the subform visible/invisible.

  5. #5
    5 Star Lounger
    Join Date
    Jan 2005
    Posts
    614
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: No data - show dashes (Access2000-03)

    My subreports just do not show up automatically when there is no data. I do not have any code for that.

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

    Re: No data - show dashes (Access2000-03)

    What clever subreports!

    You need code in the On Format event of the section of the main report that contains the subreport. For example, if the subreport is in the Detail section:

    Private Sub Details_Format(Cancel As Integer, FormatCount As Integer)
    Me.Label1.Visible = Not Me.SubReport1.HasData
    End

  7. #7
    5 Star Lounger
    Join Date
    Jan 2005
    Posts
    614
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: No data - show dashes (Access2000-03)

    Object does not support this property or method........I think Me. is need to be named somehow.

    Thanks and yes, these SUBs are so smart!

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

    Re: No data - show dashes (Access2000-03)

    In the code module belonging to a form or report, Me refers to the form or report itself.

    I had forgotten an essential keyword, sorry about that! The code should be:

    Private Sub Details_Format(Cancel As Integer, FormatCount As Integer)
    Me.Label1.Visible = Not Me.SubReport1.Report.HasData
    End

  9. #9
    5 Star Lounger
    Join Date
    Jan 2005
    Posts
    614
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: No data - show dashes (Access2000-03)

    You are forgiven a long time ago! For all the following mistakes as well as past...
    Have a good weekend and thanks so much, you are too kind!

Posting Permissions

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