I have a main form (search) that has an unbound combo box (name: OpenedDateFilter) on my main form that has the following list values. "Today";"This Week";"Last Week";"This Month";"Last Month".
My subform (Browse All Issues) has a date field (supplier_issuer_date) that I want to filter. I know it’s possible through the use of DoCmd.Applyfilter but I’m getting an error and I’m not that used to vb.
Here is what I wrote:
If Me.OpenedDateFilter = "Today" Then
DoCmd.ApplyFilter "", "(Year([supplier_issuer_date])=Year(Date()) And DatePart(""ww"",[Opened Date],0)=DatePart(""ww"",Date(),0)) = "
Me!Browse_All_Issues.SetFocus
End If
Any help would be appreciated!
My subform (Browse All Issues) has a date field (supplier_issuer_date) that I want to filter. I know it’s possible through the use of DoCmd.Applyfilter but I’m getting an error and I’m not that used to vb.
Here is what I wrote:
If Me.OpenedDateFilter = "Today" Then
DoCmd.ApplyFilter "", "(Year([supplier_issuer_date])=Year(Date()) And DatePart(""ww"",[Opened Date],0)=DatePart(""ww"",Date(),0)) = "
Me!Browse_All_Issues.SetFocus
End If
Any help would be appreciated!