filter query by year of dates

hockey8837

Registered User.
Local time
Today, 07:22
Joined
Sep 16, 2009
Messages
106
Hi,
I'm trying to filter an append query by a year selected in a combo box [cboYear] for a field [ProgramDate]. The AfterUpdate on the cbo filters the append query based off of the selection (or selections-I'm using multiple combo boxes on the form). I then run a report based off of the appended table for a report.

I set my criteria for [ProgramDate] the query to be:
Code:
Year([ProgramDate])=[Forms]![frm_rpt_Programs]![cboYear]

The above code isn't working, even when I just try to run the query while the form is open. It's still returning all records.

Suggestions or help would be greatly appreciated!
 
A little more description would be helpful for readers to provide some context.

Isn't working is not much to go on. Do you get an error?
Even a jpg of the Form could be helpful.

What is rowsource of the combo?
What column did you mean to use in the assignment?
 
Hi,
Sorry! I could have been more descriptive.

I've attached a zipped version of the DB. The form in question can be launched from the programs/events tab ([Print Program Attendance] control). The append query and the appended table are in the 'reports' section of the navigation bar.

I've been playing with it this afternoon more. When I try to run the query with the above code for [programdate], it doesn't update the table at all (appends 0 records).

Row source for combo box is
Code:
SELECT DISTINCT Year([ProgramDate]) AS [Year] FROM qryProgramsAttendeesReport ORDER BY Year([ProgramDate]);

Thanks in advance!
 

Attachments

Users who are viewing this thread

Back
Top Bottom