A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

DLookup in Query



 
 
Thread Tools Display Modes
  #1  
Old April 30th, 2009, 09:00 PM posted to microsoft.public.access.reports
gator
external usenet poster
 
Posts: 166
Default DLookup in Query

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]")
  #2  
Old April 30th, 2009, 10:35 PM posted to microsoft.public.access.reports
Marshall Barton
external usenet poster
 
Posts: 5,361
Default DLookup in Query

gator wrote:

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.

--
Marsh
MVP [MS Access]
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 01:41 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.