I have a Main Form & Subform, on the Main I have a combo Box with Date
Range
criteria, This Week, Last Week... etc.
There is no parent child relationship. Is it possible to date filter the
subform from the Main form? and if so what would the statement be?
You could base the Subform on a query referencing the combo box.
Depending on what's included in etc. you may need a VBA function, or
you might be able to use a big snarky Switch() function as the
criterion, something like
= Switch([Forms]![mainform]![cboDateRange] = "This Week",
DateAdd("d", -Weekday(Date()), Date()),
[Forms]![mainform]![cboDateRange] = "Last Week",
DateAdd("d", -7-Weekday(Date()), Date()),
<etc. etc.>)
AND
< Switch([Forms]![mainform]![cboDateRange] = "This Week",
DateAdd("d", 7-Weekday(Date()), Date()),
[Forms]![mainform]![cboDateRange] = "Last Week",
DateAdd("d", -Weekday(Date()), Date()),
<etc. etc.>)
John W. Vinson[MVP]