I have a report where I am trying to use the DSum() function as the control source for a text box and am getting the error #Name? I can't figure out where the problem is and need some help.:banghead:
The table I'm querying is tblTEMPMealCount:
MealDate (date)
BreakfastRM (integer)
MealLocation(text)
(the relevant fields)
I open the report with a form "frmSelectDate" and get [StartDate] from it. (I keep this form open until the report is closed so it is accessible to the report.) I need to display in the report from Sunday to Saturday of the week of the selected date from the form.
My control source (for BreakfastRM on Sunday of the week) is:
)
Thank you!
The table I'm querying is tblTEMPMealCount:
MealDate (date)
BreakfastRM (integer)
MealLocation(text)
(the relevant fields)
I open the report with a form "frmSelectDate" and get [StartDate] from it. (I keep this form open until the report is closed so it is accessible to the report.) I need to display in the report from Sunday to Saturday of the week of the selected date from the form.
My control source (for BreakfastRM on Sunday of the week) is:
Code:
=DSum("[BreakfastRM]","tblTEMPMealCount",[MealLocation]="Location1" And [MealDate]=[Forms]![frmSelectDate].[StartDate]-Weekday([Forms]![frmSelectDate].[StartDate])+1)
Thank you!