You could use a D function:
=DMAX("field to show","queryname")
Main Topics
Browse All TopicsHi all,
I am designing a report using MS Access. I need to fetch data to display it in the report footer. The data that needs to be displayed in the report footer comes from a qurey (F) other than the qurey (D) that fills the details section.
I am sure the the query (F) returns only one row, it is desinged to do that. I need to fill these values in text controls in the report. The query takes parameters.
I tried to put in the text field , data source property QueryF!Field1, but when I run the reports it asks me to enter a parameter named [QueyF]. I tried to used Domain Aggregate function DFirst, but still I got the same.
Thanks in advance
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
The problem you're running into is because Access only permits one recordsource per report -- header, detail, and footer.
I've solved the problem you're describing by creating a small subreport to display the results I want (usually summarized in a way not supported by Access grouping) then I just put the subreport in the footer. I suppose you could use
=DFirst("Field1","QueryF")
as the control source for each field in the footer, but it will be a little slow (IMHO). I prefer the subreport approach as it seems a little easier to understand/maintain (again, IMHO). You stated you tried DFirst and it didn't work, though I'm not sure why it wouldn't -- I tested and it seemed to work properly in the detail or footer of both a form and a report.
nabil_lb,
Are you using the quotation marks in your calls to the DFirst or DMax functions? They're not optional.
I wasn't sure whether a Domain Aggregating function could ask for a parameter, so I went and tested it. You can get the DA functions to ask for a parameter as follows:
=DFirst("Field1","queryF",
=DFirst("Field1","queryF",
=DFirst("Field1","queryF",
I'm seeing a problem though. You're QUERY takes the parameter, so it doesn't really matter whehter the DA function can request a parameter or not.
I'd return to my original suggestion: create a little report that has the data you want to display from QueryF, and drop that as a subreport onto the footer of your main report.
That gets you around all the annoyance of working through how to interact with the DA functions and should still permit you to manage the parameter in the manner you're used to.
pique_tech
This is the first time I accept an answer and assign a grade.
So, don't worry. But the reason I chose C is because the solution was not to the question I asked it was an alternative way to reach the same target.
and if you have any advice on the norms of assigning grades in experts-exchange please tell me about it.
I am sorry again. But does the assigned grade affects the number of points?
Business Accounts
Answer for Membership
by: peter57rPosted on 2005-09-28 at 04:37:38ID: 14973891
Hi nabil_lb,
> The query takes parameters.
So how do you expect the parameters to be entered?
You will need to use Domain Aggregate function but we need to be clear about the parameters first.
Pete