DLookup in Query

  • Thread starter Thread starter gator
  • Start date Start date
G

gator

I have a report showing totals for each account for the month. I am trying
to add a textbox for each account that shows the totals for the prior month.
Below is what I last tried and I can't find the right syntax.
200901TransactionsTotalsQuery is a Totals query, that's why I used DLookup
instead of DSUM. can someone help?

=DLookUp("[AccountTotals]","200901TransactionsTotalsQuery","[TranAccount]
=[TranAccount]")
 
gator said:
I have a report showing totals for each account for the month. I am trying
to add a textbox for each account that shows the totals for the prior month.
Below is what I last tried and I can't find the right syntax.
200901TransactionsTotalsQuery is a Totals query, that's why I used DLookup
instead of DSUM. can someone help?

=DLookUp("[AccountTotals]","200901TransactionsTotalsQuery","[TranAccount]
=[TranAccount]")


If TranAccount is a numeric type field:
=DLookUp("[AccountTotals]","200901TransactionsTotalsQuery","[TranAccount]
= " & [TranAccount")

If it's a Text field:
=DLookUp("[AccountTotals]","200901TransactionsTotalsQuery","[TranAccount]
= """ & [TranAccount"""")

It seems like using a subreport based on the
200901TransactionsTotalsQuery query would be easier/faster.
 
Back
Top