L
LeAnne
As I first posted back on 1/7/2009, I'm working on a database of stream
cleanup events held by volunteer organizations. I have an unbound form with
a combo box, and an unbound listbox (which shows 3 fields) that displays
results based on the selection in the cbo. The user selects the name of the
organization from the cbo, and the listbox displays all cleanup events that
organization has done (fields: eventID (hidden), which is the Bound column,
stream name, watershed, and cleanup date). I'd like for the user to click on
a listbox selection to open a subform, CleanupDetails, based on a crosstab
query, to display the eventID (again, the bound column) plus trash types
(tires, bulk items, mixed recyclables etc.) and amounts collected for the
eventID of the selected cleanup event in the listbox. Seems like this should
be easy...But I haven't done this in so long. I tried to filter the xtab
query which is the Recordsource for the subform based on the selected value
in the listbox:
TRANSFORM First(CleanupDetails.TrashCount) AS FirstOfTrashCount
SELECT CleanupEvents.EventID
FROM CleanupEvents INNER JOIN (CleanupDetails INNER JOIN Lookup_TrashTypes
ON CleanupDetails.TrashTypeID = Lookup_TrashTypes.TrashTypeID) ON
CleanupEvents.EventID = CleanupDetails.EventID
WHERE (((CleanupDetails.EventID)=[Forms]![TestForm2]![List2]))
GROUP BY CleanupEvents.EventID
ORDER BY CleanupEvents.EventID, Lookup_TrashTypes.TrashType
PIVOT Lookup_TrashTypes.TrashType;
But I keep getting an error message that the Jet db engine doesn't recognize
[Forms]![TestForm2]![List2] as a valid fieldname or expression. And I can't
link the master/child fields of the listbox because the form is unbound.
Clearly I'm missing something vital. Any help would be MUCH appreciated.
cleanup events held by volunteer organizations. I have an unbound form with
a combo box, and an unbound listbox (which shows 3 fields) that displays
results based on the selection in the cbo. The user selects the name of the
organization from the cbo, and the listbox displays all cleanup events that
organization has done (fields: eventID (hidden), which is the Bound column,
stream name, watershed, and cleanup date). I'd like for the user to click on
a listbox selection to open a subform, CleanupDetails, based on a crosstab
query, to display the eventID (again, the bound column) plus trash types
(tires, bulk items, mixed recyclables etc.) and amounts collected for the
eventID of the selected cleanup event in the listbox. Seems like this should
be easy...But I haven't done this in so long. I tried to filter the xtab
query which is the Recordsource for the subform based on the selected value
in the listbox:
TRANSFORM First(CleanupDetails.TrashCount) AS FirstOfTrashCount
SELECT CleanupEvents.EventID
FROM CleanupEvents INNER JOIN (CleanupDetails INNER JOIN Lookup_TrashTypes
ON CleanupDetails.TrashTypeID = Lookup_TrashTypes.TrashTypeID) ON
CleanupEvents.EventID = CleanupDetails.EventID
WHERE (((CleanupDetails.EventID)=[Forms]![TestForm2]![List2]))
GROUP BY CleanupEvents.EventID
ORDER BY CleanupEvents.EventID, Lookup_TrashTypes.TrashType
PIVOT Lookup_TrashTypes.TrashType;
But I keep getting an error message that the Jet db engine doesn't recognize
[Forms]![TestForm2]![List2] as a valid fieldname or expression. And I can't
link the master/child fields of the listbox because the form is unbound.
Clearly I'm missing something vital. Any help would be MUCH appreciated.