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 
No records in subform
Walter Oliver 
     
4 years ago
I have a subform which is a child list to a main form parent. Some parents have no children, which is a valid case. When this happens, the subform shows "New" on an otherwise blank line. I'd like to detect this case and highlight it to the user with a MsgBox. I can't figure out what event to use.
Adam Schwanz  @Reply  
            
4 years ago
You could just DCount to see if there are any matching records in the on current event of the parent form. Then msgbox or hide the subform or whatever you want to do
Walter Oliver OP  @Reply  
     
4 years ago
Thanks. Could I trouble you to include some sample code for implementing this solution?
Adam Schwanz  @Reply  
            
4 years ago
It's kind of hard without knowing your field/tables. I'll use the Order/OrderDetails setup Rick uses. That video will give you the information you need to do it on your own though.

Start by checking in the child table if there are any related records and then act appropriately.

IF DCOUNT("ID","OrderDetailsT","OrderID=" & OrderID)>=1
'There are matching records
Else
'There are not matching records
Msgbox "No Records"
End If
Walter Oliver OP  @Reply  
     
4 years ago
Perfect. Thanks.

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 12:54:33 AM. PLT: 2s