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 
Apply Filters in the Fitness Series
Julius Cunningham 
     
6 months ago
All of my forms are stand alone.  I have no subforms.  I did not go the route that Richard Rost did.

In the FoodListF it is set up exactly like your illustration.

If I use the FoodGroupFilter and/or the IsActive Filter, they function fine.
If I use the FoodDescriptionFilter the form blanks itself completely and sets the focus in the FoodGroupFilter.
If I then reset the form, everything returns to normal.  I just can't make it filter by description.
Help.


John Davy  @Reply  
         
6 months ago
Show us some code!  John
Julius Cunningham OP  @Reply  
     
6 months ago
Private Sub ApplyFilters()


    Dim F As String
    F = " "
    '  Food Group
    If Not IsNull(FoodGroupFilter) Then  'i.e. check if there's sumthing in the FoodGroupFilter
        F = "FoodGroupID=" & FoodGroupFilter
    End If
    '  Food Description
    If Not IsNull(FoodDescriptionFilter) Then 'i.e. check if there's sumthing in the FoodDescriptionFilter
            If F <> " " Then F = F & " AND "
                F = F & "FoodDescription  LIKE ""*" & FoodDescriptionFilter & "*"""
           End If
     '  Active Status
     If IsActiveFilter = "Active" Then
            If F <> " " Then F = F & " AND "
            F = F & "IsActive=TRUE"
     ElseIf IsActiveFilter = "Not Active" Then
            If F <> " " Then F = F & " AND "
            F = F & "IsActive=FALSE"
     End If
         If F = " " Then
             Me.FilterOn = False
         Else
             Me.Filter = F
             Me.FilterOn = True
     End If
     End Sub
Donald Blackwell  @Reply  
       
6 months ago
Have you tried:

MsgBox F

or

Status F (if you're using Richard's Status Box)

After the last "End If" and before the "End Sub"?

This would let you see what is being presented to the Filter which would explain why it is coming up blank.
Julius Cunningham OP  @Reply  
     
6 months ago
When the form FoodList loads, the MsgBox F reads IsActive = TRUE

When I enter ba in the FoodDescriptionFilter,

MsgBox F reads FoodDescription LIKE "*ba*" AND IsActive=TRUE
Donald Blackwell  @Reply  
       
6 months ago
Your code is almost identical to Richard's then so the only thing I can think to do is re-double check that your control names and field names are spelled the same is in code.

In fact, I opened a copy of the stock Fitness Database, commented out Richard's sub and pasted yours and it works perfectly.
Julius Cunningham OP  @Reply  
     
5 months ago
Thanks for you help.  I have checked everything ( I think), spellings, spacings, queries etc.  I'm going to set this aside for now and move on.  But thanks.  It's good to know that the code works, but, not for me....

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/2/2026 3:23:31 AM. PLT: 1s