I have a database, with table Car_Parts_Tbl with fields:
ID
Make "Text"
Series "Text"
Model "Text"
YearVal_From "Number" Not Date
YearVal_To "Number Not Date
Part "Text"
Qty "Number"
I have created a query(Car_Parts_Tbl Query) based on selections on a Form (Data_Entry_Form1)
Query in based on the Car_Parts_Tbl and has all its field also except ID
So far I have figured everything that I wanted to except: In the criteria field of the [YearVal_From] of the query.
I have written
Like IIf([Forms]![Data_Entry_Form1]![Year_From] Is Null,"*") Or >=[Forms]![Data_Entry_Form1]![Year_From]
It shows me all the records if the (Year_From combo box of the form) is NULL, and it has a value, it shows all the records where the Year value is same or greater.
But there is a problem. for Eg.
If have a record
MAKE MODEL YearVal_From YearVal_To Part Qty
BMW E60 2004 2010 XX 2
If the form has the value 2004, I see this record, and all of them above 2004.
But If I choose 2005 It doesnt show me this record.
Since 2005 falls in the records range of YearVal_From 2004 YearVal To 2010
I want it to show.
I have tried a few different things, like Between and Dmax... but nothing seems to be working, I am tired scratching my head!!!!!!!!!
Please help.......
I have attached a sample databaseSample DB.accdb
Thanks