Hi,
I have a text box on report where I need to have dsum return a total.
The records I need the total from are not in the table that is the report's recordsource, and to complicate things further, I need to use a variable that is derived from behind the report in the criteria for the dsum.
When I try to see print preview, this version of the statement errors before opening saying "Access cannot find the field 'SavingsPeriodEndDate' referred to in your expression":
Me.Text127.ControlSource = "=DSum('[CostPerPaycheck]','tblSavingsFunds','[FundsStatus] = 'Waiting' and #" & [nextpayday] & "# <= #" & [SavingsPeriodEndDate] & "#')"
[SavingsPeriodBeginDate]and [FundStatus] are fields in tblSavingsFunds.
nextpayday is a date variable set in the same section of code where this controlsource statement is (report_open).
Thank you