Results 1 to 4 of 4
  1. #1
    4 Star Lounger
    Join Date
    May 2003
    Location
    Austin
    Posts
    401
    Thanks
    0
    Thanked 0 Times in 0 Posts

    No data in group (No data for Group in report)

    How do you print out a string value such as "no applicable records" for a group in a report?
    I have a group with 1 of 4 possible values
    (1,2,3 or 4)
    (I don't want to cancel the printing of the report, just say that there are no applicable records
    in either a label or text box)
    I tried the If value = x then lbl.visible = true
    but it doesn't seem to work. correctly.

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: No data in group (No data for Group in report)

    I don't quite understand what you're trying to do. The NoData event applies to the form as a whole. If you are grouping on a value, then I know of no way to insert an empty group for a missing value.
    Charlotte

  3. #3
    4 Star Lounger
    Join Date
    May 2003
    Location
    Austin
    Posts
    401
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: No data in group (No data for Group in report)

    I guess I should clarify.
    I have a report that runs for each section of the customers we service.
    This report notifies them of jobs coming their way.
    If no jobs are headed their way, I'd like to state that.
    Sending a blank piece of paper, with their heading on it is my current option.
    Is there nothing that can be done in the on format event?

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

    Re: No data in group (No data for Group in report)

    I presume that the record source of your report produces ALL groups, including those without jobs (probably a query with an outer join).

    Put an invisible text box in the group header with control source
    =Count([Job])
    where Job should be replaced by the name of a field that occurs in the detail section. Let's say this text box is named txtGroupCount.

    Put a label in the detail section with the text you want to appear when the group is empty. You can put it on top of the ordinary controls in that section if necessary - they will never be displayes at the same time. I'll call this label lblGroupEmpty.

    Put the following instruction in the OnFormat event handler of the group header (or of the detail section):
    lblGroupEmpty.Visible = (txtGroupCount = 0)

    (If you would like the text to appear in the group header, you can put the label there. In that case, the code must be in the OnFormat event handler of the group header.)

Posting Permissions

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