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 
Subform filtering
Dave McKee 
    
3 years ago
Hi everyone

I have a question about subform filtering when using one form to open another parent and child form/subform. I have 3 forms:

A = continuous form with a list of customers
B = single form with single customer details
C = a continuous Subform (parent / child with B) with scheduled visits dates for each customer

SubForm C has a form-level filter applied in the Data tab of the Property Sheet - [VisitDate]>=Date()-14 Or IsNull([VisitDate]) - to display recent and upcoming scheduled visits. It deliberately does not display visits that occurred more than a fortnight ago.

When I open Form B directly in Access, subform C filters the records by date as expected. However, if I use Form A (full customer list) to open Form B (specific customer), Forms B and C load OK but subform C is no longer filtered by date.

Is it possible to have subform C filter the dates if the parent form (B) is opened by another form (A)? Thanks.
Kevin Robertson  @Reply  
          
3 years ago
Add some filter code to the event that opens the form (similar to my code below).

Private Sub CustomerID_DblClick(Cancel As Integer)

    DoCmd.OpenForm "CustomerF", , , "CustomerID=" & CustomerID
    With Forms!CustomerF!VisitF.Form
        .Filter = "VisitDate>=Date()-14 Or IsNull(VisitDate)"
        .FilterOn = True
    End With
    
End Sub
Dave McKee OP  @Reply  
    
3 years ago
Hi Kevin

Many thanks, that worked perfectly.

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: 6/10/2026 3:02:09 AM. PLT: 1s