• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 310
  • Last Modified:

How do I reference the detail section of an access report to check if itis empty

I have a report that breaks on client. If there is no detail information for a client I want to display a text box that says "No information". I have the text box hidden and will change it to visible based on the trigger.
Problem - I have tried .HASDATA but it always returns true even if the detail section is empty.
I have dozens of clients and they are populated 95% of thie time. This will put the finishing touches on the report.
0
nickmark
Asked:
nickmark
  • 3
  • 2
1 Solution
 
als315Commented:
Try to use report event - On No Data and there set your control to visible
0
 
nickmarkAuthor Commented:
The report will always have data but some of the detail sections will not. For instance there will be data for 40 clients but no data for one. Can I put this on the report level or do I need something on the detail level. This report breaks on Ckient.
Thanks
0
 
als315Commented:
Is client presented in source query if there are no data records? May be for your case is better to use subreports, where you can analyze - are there data or not
0
NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.

 
peter57rCommented:
I assume you must be using a left join to include all clients in your report and that there is a group based on clientid or similar.

In the group header print event procedure test for a sum value that should be non-zero if there are records to print.  You can hide or display your message depending on the result..

like..
If sum(shippingfee) = 0 Then
Me.LabelNoData.Visible = True
Else
Me.LabelNoData.Visible = False
End If

You must use a Sum().
You cannot use a COUNT() function because there must be (at least) one record present to create the group header, so the Count() will never be zero.

0
 
nickmarkAuthor Commented:
Thanks - I will modify the report. I appreciate your help!
0
 
nickmarkAuthor Commented:
Thanks - That is exactly what I ended up with as my solution.
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now