Ok, here’s a tough one that has all the programmers here scratching their heads…
i have a key sign out table that has a date field (let’s just say this date is for when a key was returned)
i have a form that is used to enter search criteria, one section of which searches on that date field. i have 2 text boxes in the form for dates, one is “after” (search for dates after the one entered) and one is “before” (search for dates before the one entered). if both are entered, it searches between the “after” and the “before dates. if no dates are entered (searching on something other than the date field) it enters the date “12/30/1899” (the beginning of time according to Access) and “Now()” to find all dates between the beginning of time and today (basically all dates). this works perfect for records where there is a date in this date field. however, this date field will have many (in fact most) records where this date is blank (because all keys will not have been returned yet). this search method will only work when there are dates in the field, but if date search criteria is not entered (wanting to retrieve all records) it will eliminate all records where the date is blank.
i have used this method when searching a text field. if the field has blanks, i use the Nz(field) function to find all records when searching for “*” in that field. this obviously will not work for dates, because the date “0” is not between 12/30/1899 and now.
please help!
thanks in advance