I'm having trouble with a field on a report. The field needs to show a sum of the records that have been entered in the calendar year, and also have a value of "6" in one of the table fields.
I wasn't sure how to make the report object know what year it is, so I thought of placing an invisible text box on the form, format it as yyyy and use =Date() as the control source. If that's not a good way to do it, please advise.
Report = rptActivitySummary
Table = tblWARNData (control source for report)
Form = frmReportCriteria (users enter date range, etc)
YYYY object = txtYear on frmReportCriteria
Tbl Field 1 = EntryDate (date record entered)
Tbl Field 2 = IncidType
This is my current SQL, but it's not working.
If(Year([EntryDate])=[Forms]![frmRptCriteria]![txtYear]) Then Sum(Abs([IncidType])="6")
Any advice will be greatly appreciated. TIA!