tblYear has two fields, YrID as autonumber and YrEnd as date type.
tblTaskDetails has a field TaskDate as a date type also.
I have a search form with a combo box cboSrchYear which is bound to tblYear. My user selects a year (I used the Year function so that only the year shows in the combo box).
I built a select query in the query builder. The criteria refers back to the selection in the search form [Forms]![frmMainMenu]![cboSrchYear]. I setup the field in the query as: TskDate: Year([TaskDate]).
With all the details above, here is my ultimate goal. I am searching for all records in tblTaskDetails with a year of XXXX. I will have many different task dates. In my sample data, I have 3 tasks with dates in 2011. When I run the query, nothing shows up.
As I read my post back before submitting, I figured out cboSrchYear on the search form is bound to the id and not the date. Is that my problem. I could make cboSrchYear bound to the YrEnd field since it will always be a unique date since I am only using the table for search purposes.
I seem to remember the Year function is just formatting and only extracts the year portion of a date. The contents of the field is still a full date.
I am just a little confused at this point.
tblTaskDetails has a field TaskDate as a date type also.
I have a search form with a combo box cboSrchYear which is bound to tblYear. My user selects a year (I used the Year function so that only the year shows in the combo box).
I built a select query in the query builder. The criteria refers back to the selection in the search form [Forms]![frmMainMenu]![cboSrchYear]. I setup the field in the query as: TskDate: Year([TaskDate]).
With all the details above, here is my ultimate goal. I am searching for all records in tblTaskDetails with a year of XXXX. I will have many different task dates. In my sample data, I have 3 tasks with dates in 2011. When I run the query, nothing shows up.
As I read my post back before submitting, I figured out cboSrchYear on the search form is bound to the id and not the date. Is that my problem. I could make cboSrchYear bound to the YrEnd field since it will always be a unique date since I am only using the table for search purposes.
I seem to remember the Year function is just formatting and only extracts the year portion of a date. The contents of the field is still a full date.
I am just a little confused at this point.