G
Guest
Hi All,
I put this code in my Textbox (named Balance1) and it works beautifully:
=IIf([TMonth] Is Null,Null,nz(DSum("[ItemAmount]","vDonationsDetail","[TDate]
ExpensesDetails table. I want my form (CashBook) to display information on
various accounts depending on the month a user picks.
The problem is that I had to go round about when my original code was
rejected as wrong syntax: =IIf([TMonth] Is
Null,Null,nz(DSum("[ItemAmount]","vDonationsDetail","Format([TDate],"mmmm
yyyy") = Forms!CashBook!TMonth"),0)).
I had intended that a user would simply enter TMonth as Month Year and the
textbox would do the rest. But When I attempted to format the TDate field
along this line, the syntax was rejected. Is it not allowed to nest a
function within an aggregate function DSum? If it is allowed then what is the
correct syntax?
I put this code in my Textbox (named Balance1) and it works beautifully:
=IIf([TMonth] Is Null,Null,nz(DSum("[ItemAmount]","vDonationsDetail","[TDate]
vDonationsDetails is a union query that combines DonationsDetails table with= Forms!CashBook!B4Date+1 And [TDate]<=Forms!CashBook!EndDate"),0)).
ExpensesDetails table. I want my form (CashBook) to display information on
various accounts depending on the month a user picks.
The problem is that I had to go round about when my original code was
rejected as wrong syntax: =IIf([TMonth] Is
Null,Null,nz(DSum("[ItemAmount]","vDonationsDetail","Format([TDate],"mmmm
yyyy") = Forms!CashBook!TMonth"),0)).
I had intended that a user would simply enter TMonth as Month Year and the
textbox would do the rest. But When I attempted to format the TDate field
along this line, the syntax was rejected. Is it not allowed to nest a
function within an aggregate function DSum? If it is allowed then what is the
correct syntax?