Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Help   Contact   Merch   Join   Order   Logon   Forums   
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Report CanShrink for Empty Notes
David Clement 
      
10 days ago
Good Evening Richard,
I have made a Report with a Notes field. Not all records in the report will have notes. Is there a way to hide the Label "Notes" when there are no notes on that record? I have set the notes field to Can Grow=Yes and Can Shrink=Yes. I want a cleaner looking report when I need to print it out. ChatGPT and I struggled with this and could not get it to work.

I think I sort of remember a video on how to do this?
Thank you.
Kevin Yip  @Reply  
     
10 days ago
The report's Detail Format event can do this.  This event runs right before each record is printed.  In the event, write VBA code that checks if the notes field of the current record is empty not, then hide or unhide the label accordingly.
Richard Rost  @Reply  
           
10 days ago
Kevin is right that you can handle it with a little VBA in the Detail section's Format event. However, there's a good chance you don't need any programming at all.

Set both the Notes field itself and the section it is in to CanShrink = Yes. You also have to make sure there is nothing beside the Notes field, including its label, because labels can't shrink. If the label is next to the field, it can prevent the empty space from collapsing.

I cover all of that in this video:

Can Grow, Shrink
David Clement OP  @Reply  
      
9 days ago
I have watched the video Can Grow, Can Shrink and I guess I must not fully understand the label and text box must be attached. I have tried multiple times to get this to work. I have checked the VBA code, it looks fine. Just can't get the label Notes to re-appear when needed. I am sure it's something simple that I have overlooked.
Dan North  @Reply  
      
9 days ago
One other thing you can try to hide the label itself is to use a conditional statement (if then or select case) to set the ".visible" to false.  May not help with the can shrink property, but it will hide the label on records with no notes.  See example from one of my forms below.  Hope it helps:
    '[20260223-DAN]-Records cleanup, only show legacy records if they still exist
    If Not IsNull(NotesText) Then
        NotesText.Visible = True
        NotesLabel.Visible = True
    Else
        NotesText.Visible = False
        NotesLabel.Visible = False
    End If
Kevin Robertson  @Reply  
          
9 days ago
I would code it like this:

    If Nz(NotesText, "") = "" Then
        NotesLabel.Visible = False
    Else
        NotesLabel.Visible = True
    End If


If Can Grow / Can Shrink is set to Yes, you shouldn't need to control the visibility of NotesText.
Richard Rost  @Reply  
           
9 days ago
The important part is that you have to explicitly turn the label back on in the Else. The Format event runs once for every record. If one record hides the label and the next record has notes, the label will stay hidden unless you set it back to True.

Also make sure NotesLabel is the actual Name property of the label control, not just the caption that says "Notes.
David Clement OP  @Reply  
      
9 days ago
By George, I think I've got it!
Thank to all!
John Davy  @Reply  
         
9 days ago
Hi David, Maybe By Kevin and by Richard, I think I've got it! John
Add a Reply Upload an Image
Next Unseen

 
 
What's This?

 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 9/20/2026 7:22:42 PM. PLT: 1s