View Single Post
  #5  
Old November 5th, 2009, 08:34 PM posted to microsoft.public.access.forms
Dirk Goldgar
external usenet poster
 
Posts: 2,529
Default Show all records

"Jacques Latoison" Jacques Latoison at hotmail dot com wrote in message
...
A couple issues with that.
What's in the Combo box comes from another query or table.
How would I add an option to clear the list?


You don't clear the list, you clear the combo. For unbound controls, if you
delete the value displayed in the control, the control's value will be Null.

Of course, yoou can also set up a RowSource query that includes a selection
for "(unfiltered)", with a vaule of Null. But that's more complicated.

Yes, I did mean a combo box (the users call it a drop down list).
I assume I can put the below in the criteria field, or should I make and
expression.


You wouldn't put it directly in the Criteria cell of a query grid, because
what I posted was a snippet of SQL. In a criteria cell of a query design
grid, under the field to be filtered, you'd put something like:

[Forms]![YourForm]![cboYourCombo] OR
([Forms]![YourForm]![cboYourCombo Is Null])

That should be entered all on one line. Access will be able to make sense
of it. But if you're going to do this for multiple fields, do them all at
once, before changing views. When you switch to some other view and then
back to design view, Access will have rearranged things in the design grid
and may have made it harder to make subsequent adjustments correctly.

I assume the SomeField would by the field in question in the query?


Right.

--
Dirk Goldgar, MS Access MVP
Access tips: www.datagnostics.com/tips.html

(please reply to the newsgroup)