Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pull data from a specific query in a report running another query 2

Status
Not open for further replies.

Triacona

Technical User
Jun 11, 2009
462
GB
Hi, [ponder]

I am running a report off a query DATEDEC.
Within that report I have certain cases counted meeting certin criteria.
I do not want to use a sub report, (I've tried it and it works, but I want a more succint way)
I have a query which has no criteria - the query I intend to use called NCDateValiDateDec.
I have used the follwing code in the report:
=Count(IIf([Queries]![NCDateValiDateDec].[DECSN] In ("PER","PERLEG","REF"),0))
When I run the report, it asks me for the above criteria.
What I want it to do is run NCDateValiDateDec with the above criteria within the report.
how would I pull through this queries data?
Any help would be very much apppreciated [smile]
Kind regards
Triacona
 
Have you tried any of the Domain Aggregate functions, such as DCount() & DLookup()?

Cogito eggo sum – I think, therefore I am a waffle.
 
Hi Genomon,
Thank you for your help.
I have used Dcount as below: (AllDet is the query DESCN is the field)
=Dcount([AllDet],[DECSN], In (“PER”,”REF”,”PERLEG”,”ENREF”))
is this the correct way as I am getting an error: [ponder]
"The Expression you have entered contains invalid syntax"
"You may have entered a comma without a preceding value or identifier"

Should I be referencing it as such: =dcount([Query]![AllDet],[DECSN],In (“PER”,”REF”,”PERLEG”,”ENREF”))
Thank you again for your help.
Any futher help will be much appreciated. [bigsmile]
Kind regards
Triacona

 
Have you tried this ?
Code:
=DCount("*","AllDet","DECSN In ('PER','REF','PERLEG','ENREF')")

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
I only have Access 2003 so I don't know if your syntax is new in 2007. But in 2003 the following should work:
Code:
=dcount("[DECSN]","[AllDet]","[DECSN] in ('PER', 'REF', 'PERLEG', 'ENREF')")

Note that the domain functions are often a little slow...

HTH
pjm
 
Thank you very, very much [bigsmile] [2thumbsup]
I really appreciate it!!
It works!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top