What exactly are you trying to do, just get a list of holidays within a given cycle?
i.e.
You have a cycle with an ID of 54 in your table, that cycle runs from 6/11/2014 through 1/6/2015.
In your Holiday List table you have these holidays between those two dates
ID |
Holidays |
HDate |
ProgYr |
36 |
Independence Day |
Friday, July 04, 2014 |
15 |
37 |
Labor Day |
Monday, September 01, 2014 |
15 |
38 |
Columbus Day |
Monday, October 13, 2014 |
15 |
39 |
Veterans Day |
Tuesday, November 11, 2014 |
15 |
40 |
Day before Thanksgiving (pm classes) |
Wednesday, November 26, 2014 |
15 |
41 |
Thanksgiving Day |
Thursday, November 27, 2014 |
15 |
42 |
Day after Thanksgiving (day classes) |
Friday, November 28, 2014 |
15 |
43 |
Christmas Eve (pm classes) |
Wednesday, December 24, 2014 |
15 |
44 |
Christmas Day |
Thursday, December 25, 2014 |
15 |
45 |
Christmas Break |
Friday, December 26, 2014 |
15 |
46 |
Christmas Break |
Monday, December 29, 2014 |
15 |
47 |
Christmas Break |
Tuesday, December 30, 2014 |
15 |
48 |
Christmas Break |
Wednesday, December 31, 2014 |
15 |
49 |
New Year's Day |
Thursday, January 01, 2015 |
15 |
If all you want to do is bring these dates onto your report (the way you have it designed you'll likely need 2 subreports on a main report to make it work) here's what you do.
On your form PROGRAM & CYCLES FORM, ceate a text box and name it CURRENTCYCLE
(just a word of advice, don't use spaces or special characters in your object names, it will cause you no end of grief in the long run use underscore (_) to indicate a space and don't use special characters at all)
IN the CONTROL SOURCE of CURRENTCYCLE put in =[Cycles Query subform]![id]
This will adopt the cycle ID from your subform.
Next, create this query
Code:
SELECT Cycles.ID AS CYCLEID, [Holiday List Table].id AS HOLIDAYID, [Holiday List Table].Holidays, [Holiday List Table].HDate, [Holiday List Table].ProgYr, IIf([hdate] Between [start date] And [end date],1,0) AS Show
FROM Cycles, [Holiday List Table]
WHERE (((Cycles.ID)=[forms]![Program & Cycles Form]![CurrentCycle]) AND ((IIf([hdate] Between [start date] And [end date],1,0))=1));
This is using a cartesian join but I am selecting a single period (the 'current' item in in the subform) and then using a formula (the one labeled SHOW) to determine which holidays fall in that specific cycle's date range.