Presumably you have criteria in your query that looks something like this:
[Forms].[Form1].[txtYear]
Switch the query to SQL View (View menu), and change the WHERE clause to
something like this:
([MyYear] Is Null) OR ([MyYear] = [Forms].[Form1].[txtYear]
where "MyYear" represents the name of your field.
I suggest you don't use YEAR as a field name: there is a Year() function in
VBA, and so code can get confused about what you are talking about.
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users -
http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"mar10" <ma****@yahoo.c om> wrote in message
news:11******** **************@ z14g2000cwz.goo glegroups.com.. .
I have a form that has a drop down box on it which allows the user to
select a YEAR. If the user makes a selection I have a subform that is
driven by a query that will select the YEAR that the user picked. If
the user does not select a year I want to find all items on the
underlying subform. There are Null YEARs in the data base.
I thought if I had my query either select the YEAR picked or "*" it
would find everything, but I guess "*" does not find Null values.
I'm sure it's something simple that I'm just not thinking of, but
how do I have the underlying query select everything is the YEAR
dropdown is empty?
Thanks