View Full Version : Apply Filter returns new record


mileslowe
03-08-2009, 12:06 PM
I am not a seasoned access programmer so I hope I present this in an understandable manner. I am trying to filter an access 2003 database with a filter to find all records for today. The filter works but always brings up a new record if the date is not found. Because I have VBA code in the forms On Current event to load labels (which may change from time to time) labels table for the given record that is displayed, the macro then closes and adds another new blank record. This does not happen if there is no code in the On Current event. I have been working for three days trying to find a way to filter but NOT let the results end up with a new record. Here is my condition that goes with the apply filter action:

I realize that I do not need the end part And Day, but want to use that later for two fields being used. (RecordDateFilter is the combo box with items already added for selection such as Today, Last Week, Next Month etc).

Condition: [Forms]![frmDailyVitals]![RecordDateFilter]="Today"

Where condition:
(Year([RecordDate])=Year(Date()) And Month([RecordDate])=Month(Date()) And Day([RecordDate])=Day(Date()))