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 
Me!Filter Missing Operator
Stanley Mc Keown 
     
14 months ago
My Me.filter works when it is only

Me.Filter = "[CalcWKDue]=" & DatePart("ww", Now(),1,2) & "And [Active]=" & " True.

But if I add

& "And [CalcYearDue]=" & DatePart("yyyy", Now(),1,2)

I get the missing operator error

The form is based on a query and both CalcWKDue and CalcYearDue are calculated fields made by that query.

  The code for the Me.Filter is in the after update event of a toggle switch.

  Can Anyone help me see what is wrong


The form data is from a Query and CalcWKDue
Sami Shamma  @Reply  
             
14 months ago
Define a String variable and put the filter in it and mshbox the string. Make sure it is correct.
Tom Juric  @Reply  
      
14 months ago
You might need a space between the double quotation and the word AND ----->> "   And [CalcYearDue]=
Kevin Robertson  @Reply  
          
14 months ago
The first thing I check is spacing. Caught me out so many times. LOL
Stanley Mc Keown OP  @Reply  
     
14 months ago
You chaps are on the money again. That space between the  " and the And of the CalcYearDue filter was the problem but curiously there was no space between the " and the And of the Active filter but the Active filter worked whereas the Year filter didn't. So I when I saw that both had no space I put the space in both expecting the Active to not work or both not work but to my surprise both work perfectly

Thanks again fellas
Tom Juric  @Reply  
      
14 months ago
was no space between the " and the And of the Active filter --> this is because the TRUE come IMMEDIATELY after the "=" sign.  In the second part the word TRUE and the second clause runs together

" & " True (ADDING) & "And [CalcYearDue]=" & DatePart("yyyy", Now(),1,2)--->>TRUEAnd [CalcYearDate]
Stanley Mc Keown OP  @Reply  
     
14 months ago
Ah I see -- thanks again Tom

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/22/2026 12:28:09 AM. PLT: 1s