-
1
- #1
Hi,
I have a report displaying items that are missing from a room. I created 2 queries, the first getting the items IN the room, and the second being an "unmatched" query that references the first query where Item is Null. I use a subreport for the details, and the results display correctly.
However, the Report_Details event of the subreport is executed about 2 or 3 times more than I would expect (I think 3 times when I have a footer, 2 times without). Since I think I've experienced this before, I'm not sure if this is a problem or an Access thing.
Since the resulting report is fine, I could live with this. BUT, I need running totals and a grand total, and these are inaccurate because of the extra number of times the detail event is performed.
So, I created a third query, which provides totals based on Query 2.
My question is: how do I put a field on the subreport (report detail line) using this query as its source???
Here's an example of the report.
Items Needed for Room Upgrade Report
Room 203
Item 1 Bedspread $10
Item 10 Gray Lamp $15
Item 21 Green Carpet $100
Room 203 Total $125
Room 205
Item 5 Artwork $40
...
...
Room 205 Total $200
...
All Rooms Grand Total $325
The 2 queries are:
Query 1 - selects the items IN the room. The SQL is (here's an example with an actual room number):
Query 2 - gives items NOT in the room; references Query1, and where Item Number is Null (this example uses specific codes for simplicity, but user will select from lists).
Now I've added Query 3 to sum the Price of all items on query 2 for a room. This will give the $10, $15, $100 price for each specific item listed above. Otherwise I can't figure out how to get the item price on this report, and I've been pulling my hair out.
Sooo... my main question is: how do I attach the results of Query 3 to a field on the detail line of my report? I have tried a text field, a combo box... to no avail.
Thank you so much! I'm in dire straits here....
Lori
I have a report displaying items that are missing from a room. I created 2 queries, the first getting the items IN the room, and the second being an "unmatched" query that references the first query where Item is Null. I use a subreport for the details, and the results display correctly.
However, the Report_Details event of the subreport is executed about 2 or 3 times more than I would expect (I think 3 times when I have a footer, 2 times without). Since I think I've experienced this before, I'm not sure if this is a problem or an Access thing.
Since the resulting report is fine, I could live with this. BUT, I need running totals and a grand total, and these are inaccurate because of the extra number of times the detail event is performed.
So, I created a third query, which provides totals based on Query 2.
My question is: how do I put a field on the subreport (report detail line) using this query as its source???
Here's an example of the report.
Items Needed for Room Upgrade Report
Room 203
Item 1 Bedspread $10
Item 10 Gray Lamp $15
Item 21 Green Carpet $100
Room 203 Total $125
Room 205
Item 5 Artwork $40
...
...
Room 205 Total $200
...
All Rooms Grand Total $325
The 2 queries are:
Query 1 - selects the items IN the room. The SQL is (here's an example with an actual room number):
Code:
SELECT tblDesignTypeItems.DesignType, tblDesignTypeItems.ItemID, tblSpaceUse.RoomID
FROM tblSpaceUse INNER JOIN (tblDesignTypeItems INNER JOIN tblRoomItems ON tblDesignTypeItems.ItemID = tblRoomItems.ItemID) ON (tblSpaceUse.RoomID = tblRoomItems.RoomID) AND (tblSpaceUse.DesignTypeID = tblDesignTypeItems.DesignType)
WHERE (((tblSpaceUse.RoomID)="340"));
Code:
SELECT tblDesignTypeItems.DesignType, tblDesignTypeItems.ItemID, qryPrototypeMissingSumCost1.ItemID
FROM tblDesignTypeItems LEFT JOIN Query1 ON tblDesignTypeItems.ItemID = Query1.ItemID
WHERE (((tblDesignTypeItems.DesignType)="c0501") AND ((Query1.ItemID) Is Null));
Sooo... my main question is: how do I attach the results of Query 3 to a field on the detail line of my report? I have tried a text field, a combo box... to no avail.
Thank you so much! I'm in dire straits here....
Lori