filter by year (1 Viewer)

tubar

Registered User.
Local time
Today, 05:20
Joined
Jul 13, 2006
Messages
190
Im trying to filter my forms date field by year with a button.
Code:
Me.Filter = "year([date])='2019'"
Me.FilterOn
when i apply the code to filter by month it works fine.
Code:
Me.Filter = "month([date])= '10'"
Me.FilterOn = True
I even tried creating an unbound text field that displays the date field formatted for year and filtering that. any suggestions on a VBA fix
 

Gasman

Enthusiastic Amateur
Local time
Today, 11:20
Joined
Sep 21, 2011
Messages
14,268
What happened to the
= True?
 

theDBguy

I’m here to help
Staff member
Local time
Today, 03:20
Joined
Oct 29, 2018
Messages
21,467
Hi. I agree with Gasman. You forgot to assign True to Me.FilterOn. Did you get an error without it?
 

Users who are viewing this thread

Top Bottom