M
Marshall Barton
rgrantz said:I have a form w/ a subform. One the form, I have several unbound controls
that the user inputs data into. These serve as the criteria that
continuously filters the query results shown in the subform. The query has
the form control names in the criteria of the applicable fields (ie. under
customer name, the criteria is [Forms]![FormName]![UnboundControl1]. I have
the "AfterUpdate" event of all the controls set to refresh the form
(me.refresh) so that the results in the subform (whose control source is the
query) continue to "drill down" as the unbound controls are filled in
(similar to the effect of the Autofilter arrows used in Excel).
What I would like to do is have it so that when a control is blanked out,
the records that were filtered by the previous text that was in the control
are again shown on AfterUpdate.
For example, when the user enters "ABC" in the "CustomerName" unbound
control, the records refresh to show only those w/ customer name of "ABC."
When user then enters "10/12/04" in the "OrderDate" unbound control, the
records are further filtered to show only Customer Name of "ABC" with orders
on 10/12/04. What I would like is when the user then deletes "10/12/04"
from the OrderDate control, the records refresh to show all the ABC orders
again, deleting the criteria and so showing more records. Right now it will
just show NO records, because no ABC customers records have an order date of
null, or "". I would like to do this for a number of criteria fields (there
will be about 8 total).
Change each field's criteria to:
WHERE ((fieldA = Forms!FormName!UnboundControl1) OR
(Forms!FormName!UnboundControl1 Is Null))
AND ((fieldB ...