I apologize in advance, because this must be very straight forward, but I'm having trouble with it. I've got a database with two tables: People and Activities. They are related using a one-to-many relationship based on CaseNumber. Each person can have multiple activities which fit into one of three categories.
I have a form where I can view each Person. That form contains a sub-form showing all of their activities. No issues there.
I'd like to create a report showing the same info. I've created a report based on the People table and have the CaseNumber in the Report Header. I've created a SubReport for the Activities information and placed it in the details section.
Back on the form, I've placed a button with the following code:
DoCmd.RunCommand acCmdSaveRecord
DoCmd.OpenReport "ReportName", acViewPreview, , "[CaseNumber] = " & [CaseNumber]
This opens the report with the correct person's CaseNumber in the Report Header, but the SubReport contains all of the activities in the Activities table. How do I limit the SubReport to the same CaseNumber?
Next, how can I then narrow down the SubReport to only show category of activity per page for that person?
Thank you very much.