Hello!
I am trying to report on a payment table by payment method ie 'Cash' and 'Cheque'. In the Table Design I have a text field called 'Method' which is a Value List.
I have created a module with the following function:
In the report I have a text box with the control source of =ClassCash().
When I open the report I get Runtime Error 2001 - You cancelled the previous operation. Funny thing is, if I remove the 'And Method=Cash' from the Function, it works fine and works out the sum of all payments on a given date.
Does anybody know how to get this function working?
I have tried changing the Table Design to just Text for the Method field removing the Value List but still get Error 2001.
I am trying to report on a payment table by payment method ie 'Cash' and 'Cheque'. In the Table Design I have a text field called 'Method' which is a Value List.
I have created a module with the following function:
Code:
Public Function ClassCash() As Currency
Dim cClass As Currency
cClass = Nz(DSum("Price", "ClassPayment", "ToPay=No AND DateUpdated=Forms!ReportDates!txtFrom AND Method=Cash"), 0)
ClassCash = cClass
End Function
In the report I have a text box with the control source of =ClassCash().
When I open the report I get Runtime Error 2001 - You cancelled the previous operation. Funny thing is, if I remove the 'And Method=Cash' from the Function, it works fine and works out the sum of all payments on a given date.
Does anybody know how to get this function working?
I have tried changing the Table Design to just Text for the Method field removing the Value List but still get Error 2001.