Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Find Record Combo    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Can This Work on a Subform
Sandra Truax 
         
4 years ago
Instead of completely having to rebuild my database that I've been using for years, is there any way I can get this to filter a subform?
Adam Schwanz  @Reply  
           
4 years ago
You can do whatever you want. Usually you're more limited by your imagination then what you could code up to do (or at least APPEAR to do with some trickery).

You will need to put the filter on the actual subform. Depending on your comfortability, VBA may be easier to accomplish it. You'd just need to call to the subform and apply a filter
Value From a Form
Sandra Truax OP  @Reply  
         
4 years ago
My Form is Budget.
My Subform is TransactionSubform.
One of the combo box filters is AccountFilter.
The filed in the subform is Account.

I think it's this part of the Event from this video that needs to be updated, but not sure how to do it so that it will select the field in the subform.

Can someone help?



Private Sub AddToFilter(FilterComboName As String)

    If IsNull(Me(FilterComboName)) Then Exit Sub
    If TempVars("Filter") <> "" Then TempVars("Filter") = TempVars("Filter") & " " & AndOrCombo & " "
    TempVars("Filter") = TempVars("Filter") & _
        Left(FilterComboName, Len(FilterComboName) - 6) & "=""" & Me(FilterComboName) & """"

End Sub

I did have it filtered by the Query, but wanted to do it this way so that I don't have to update the query every time I add a new search field since this way will include it automatically.
Adam Schwanz  @Reply  
           
4 years ago
Where is tempvars coming in? I don't recall seeing that in the video.

You should be able to do from the main form
Forms!FormName!SubFormName.Form.Filter = "State=""" & StateFilter & """"
Forms!FormName!SubFormName.Form.FilterOn = True


Or from inside the subform just
Me.Filter = "State=""" & StateFilter & """"
Me.FilterOn = True


Search Form 2.0 This video might help you setup the Search/Filter code better.
Sandra Truax OP  @Reply  
         
4 years ago
It is in the video and used so that the field doesn't have to be specified each time. I'll see if I can get your suggestion to work. Thanks Adam.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Find Record Combo.
 

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/1/2026 8:13:09 PM. PLT: 1s