I have a unbound combobox on my form that I need to filter by date range. I am using a Value List as the record source.
The combobox is name Combo63 and here is it's Row Source: It is a Value List
The Date I wish to use as the criteria is a date field with NO format assigned and no input mask. EventStart is the control date field.
"All";"Today";"This Week";"Last Week";"This Month";"Last Month";"Next Month"
How can I filter the form with this criteria?
Here is all my code to try and do it. Of course I get an error with so?..
If [Forms]![frmEvent]![Filter]="Today" Then
(Year([nextschddte])=Year(Date()) And Month([nextschddte])=Month(Date()) And Day([nextschddte])=Day(Date()))
If [Forms]![frmEvent]![Filter]="This Week"
(Year([nextschddte])=Year(Date()) And DatePart("ww",[nextschddte],0)=DatePart("ww",Date(),0))
If [Forms]![frmEvent]![Filter]="Last Week"
(Year([nextschddte])=Year(Date()) And Month([nextschddte])=Month(Date()))
If [Forms]![frmEvent]![Filter]="Last Month" Then
(Year([nextschddte])=Year(Date()) And Month([nextschddte])=(Month(Date())-1))
If [Forms]![frmEvent]![Filter]="Next Month".
(Year([nextschddte])=Year(Date()) And Month([nextschddte])=(Month(Date())+1))
If [Forms]![frmEvent]![Filter]="All"
DoCmd.ShowAllRecords