Can anyone tell me how to report "no data" in an Access report? When a field value in the detail section is null, I want to have text that says 'No results for this group header'.
"No data" for a field
Collapse
X
-
Strictly off the top of my head here... Haven't tested this in my test db, but should work fine:
In the detail section of your report put a label, set the visible property to false. In the on open event of the report, put this code:
May not be the perfect solution (like I said, I haven't tested this yet), but should put you on the right track.Code:If IsNull([YourSourceFieldName]) Then [YourLabelName].Visible = True [YourLabelName].Caption = "No results for this group header." End If
Regards,
Scott -
You are most welcome. Glad to be able to help a little...
One added thought from elsewhere on this site, is to place your invisible label exactly sized and equally formatted, over the text box that ordinarily carries the information. When this text box is null, make it invisible, and the label visible, and there is no change in the visible layout of the report (the label 'looks' like the text box)...
Regards,
ScottComment
Comment