"No data" for a field

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • prljng
    New Member
    • Aug 2007
    • 2

    #1

    "No data" for a field

    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'.
  • Scott Price
    Recognized Expert Top Contributor
    • Jul 2007
    • 1384

    #2
    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:

    Code:
    If IsNull([YourSourceFieldName]) Then
       [YourLabelName].Visible = True
       [YourLabelName].Caption = "No results for this group header."
    End If
    May not be the perfect solution (like I said, I haven't tested this yet), but should put you on the right track.

    Regards,
    Scott

    Comment

    • prljng
      New Member
      • Aug 2007
      • 2

      #3
      Thanks! This got me moving in the right direction.

      Comment

      • Scott Price
        Recognized Expert Top Contributor
        • Jul 2007
        • 1384

        #4
        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,
        Scott

        Comment

        Working...