Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Reference SubReport Property
Keith Stanton 
    
3 years ago
Hello,
I am trying to make my subreports hide/not visible based on a certain condition.
Main Report Name: MCRCoverSheetSplitAccountingR
Sub Report 1 Name: AccountingiERPR
Sub Report 2 Name: AccountingLegacyR

I am getting Run Time Error 2465  Application-defined or object-defined error

The Criteria is system name.  If the system equals YPE show sub report AccountingiERPR
If the system is anything else show sub report AccountingLegacyR

These sub reports may contain data, but only need to be visible depending on the system.

In my Main Report On Load event I have this.

    If Reports!MCRCoverSheetSplitAccountingR!SystemName = "YPE" Then
        Reports!MCRCoverSheetSplitAccountingR.AccountingLegacyR.Visible = False
    Else
        Reports!MCRCoverSheetSplitAccountingR.AccountingiERPR.Visible = False
    End If

I have tried various options unsuccessfully.  Wondering if someone could assist?
Kevin Robertson  @Reply  
          
3 years ago
First, you are setting them both to false but never showing them.
Second, you don't need the full Reports!ReportName syntax.

Try this:

    If SystemName = "YPE" Then
        AccountingLegacyR.Visible = False
        AccountingiERPR.Visible = True
    Else
        AccountingLegacyR.Visible = True
        AccountingiERPR.Visible = False
    End If


If this doesn't work or isn't what you need, we will need to see your report in Design View.
Keith Stanton OP  @Reply  
    
3 years ago
Hi Kevin, thank you for responding.

That didn't work either
New Run time error 424  Object Required.  I see if I can add pics here
Keith Stanton OP  @Reply  
    
3 years ago

Keith Stanton OP  @Reply  
    
3 years ago

Keith Stanton OP  @Reply  
    
3 years ago
Note - The labels iERP Accounting and Legacy Accounting I added only for the purpose of the pics.  They are not normally there.
Kevin Robertson  @Reply  
          
3 years ago
When you get the Runtime errors and click debug which line of code is highlighted?
Keith Stanton OP  @Reply  
    
3 years ago
Well,  it works now.  I removed and then reinserted/reattached my sub reports and now it works.
Thank You!!

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

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: 5/7/2026 10:43:38 AM. PLT: 1s