I've created a function that takes 2 dates and then should find the number of holidays between the 2 dates; the holidays are listed in a table.
I get a run-time error '2471':
The expression you entered as a query parameter produced this error: 'EndDate'
I've used the same code (without variables) on another form, and it worked fine.
Any ideas?
Code:
Function Holidays(StartDate As Date, EndDate As Date) As Integer
Holidays = DCount("*", "tblHolidays", "([HolidayDate] <= EndDate ) AND ([HolidayDate] >= StartDate )")
End Function
The expression you entered as a query parameter produced this error: 'EndDate'
I've used the same code (without variables) on another form, and it worked fine.
Any ideas?