Hi
I am trying to use date variables in an expression for dsum but cannot get the syntax correct.
I have
Public Function Cash1() As Currency
Dim StartDate As Date
Dim EndDate as Date
StartDate = Forms!FrmDates!StartDate
EndDate = Forms!FrmDates!EndDate
Cash1 = DSum("[Cash]", "QrySalesByDate", "[date1] between #" & StartDate & " # " and #" & EndDate & " # ")
End Function
Can anyone tell me what I am doing wrong?
Many thanks