Report based on Totals Query giving Problems

plantfinder

Registered User.
Local time
Today, 08:39
Joined
Sep 28, 2002
Messages
12
I have query based on 2 tables, Plants and Photos. In order to bring up only unique records from the Plant Table, I have created a Totals Query and in the 2 Query fields from the Photos Table I have the Total Row selceted to First. All other fields are from the Plant Table and are set to Group By.
The Query in Datasheet View gives me exactly the records I want.
The problem is that when I try to open a Report based on this Query I am getting 2 parameter dialog boxes asking me for the value in the two Photo Fields that have set tow First. If the Query works, why can't the report? Any suggestions would be appreciated.

Thanks
Mike
 
OK, Mike. I answered your previous question thus:

I assume your picture table has an ID number for the pictures that you use to link to the plant table. Create a query that selects all of the data that you want and includes the key for the pictures eg PicID. Set the totals line for the plant as Group by, and for PicID to MAX or MIN or whatever you want. This will ensure that only one picture is selected.
Then create another query that links this first query to the actual images in the picture table.
Voila!


Now I find that if I base the report on the second query suggested above, it works no problem. I can't give you a sound explanation as to why this works and the query with the aggregates in doesn't but there you go!
 

Users who are viewing this thread

Back
Top Bottom