DLookup in Query

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]")
 
M

Marshall Barton

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top