Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Sep 2001
    Location
    Wellington, Wellington, New Zealand
    Posts
    181
    Thanks
    0
    Thanked 0 Times in 0 Posts

    No Data msg for Subreport (Access 2000)

    Hi

    I have a report with the product name grouped and includes two subreports (sale and use conditions) in the detail section. For any product, there may be no data in one or both subreports. Each subreport in their report heading has a label 'Sale Conditions' for one and 'Use Conditions' for the other. So if there is no data for one of the subreports I need a label to say 'No Sale Conditions' or 'No Use Conditions' depending on which subreport has no data. If both have no data then I need a single label to state 'This product has no Sale and Use Conditions'.

    Both the detail section and subreports have had the shrink properties set to yes.

    The problem is I'm not sure on how to do this. Any assistance would be much appreciated.

    Regards

    WTH

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

    Re: No Data msg for Subreport (Access 2000)

    You can use the HasDate property of a report: it is True if the report displays records, False otherwise. Try a text box on the main report with control source

    =IIf([SaleSubReport].Report.HasData, IIf([UseSubReport].Report.HasData, Null, "No Use Conditions"), IIf([UseSubReport].Report.HasData, "No Sale Conditions, "No Sale Or Use Conditions"))

    You must use the names of the subreports as controls on the main report; these are not necessarily the same as the names they have in the database window.

  3. #3
    2 Star Lounger
    Join Date
    Sep 2001
    Location
    Wellington, Wellington, New Zealand
    Posts
    181
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: No Data msg for Subreport (Access 2000)

    Hi Hans

    Many thanks for the advice (as usual). I tweaked your suggestion for formatting reasons as I wanted two text boxes. The code I used:

    Textbox1
    =IIf([qrylinkconditions subreport].Report.HasData,Null,IIf(Child16.Report.HasData,"N o Sale Conditions","No Sale or Use Conditions"))

    TextBox2
    =IIf(Child16.Report.HasData,Null,IIf([qrylinkconditions subreport].Report.HasData,"No Use Conditions",Null))

    Regards
    WTH

Posting Permissions

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