Link to home
Start Free TrialLog in
Avatar of D J
D JFlag for United States of America

asked on

MS Access How can I create a query for my report to filter the sub-form contents?

I have a typical multi-select set up, 2 data tables with a join table. The multi-select data is being displayed in a report via sub-form.

How can I create a report that filters the sub-form data for the report?
For example:
Each project can have multiple documents associated:
Report:
Project 1
   Doc 10 (Sub-form in report)
   Doc 11
   Doc 50
Project 2
  Doc 11 (Sub-form in report)
  Doc 30
  Doc 60
How can I create a query to filter the sub-form contents; I.E. display only projects with Doc 50:
Report output:
Project 1
   Doc 10 (Sub-form in report)
   Doc 11
   Doc 50
ASKER CERTIFIED SOLUTION
Avatar of Paul Cook-Giles
Paul Cook-Giles
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of D J

ASKER

Thanks Paul:  One more quick question:
My query is set up to ask a question:
[Please Enter Doc No]
How can I add a static entry for the user?
I.E. The user has to enter Document 10 to filter all records.
How can I automatically add "Document" so the user can just input the number?
[Please Enter Doc No]
User will input 10 in lieu of document 10.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I understand that you might want to reward "participation" but it really helps no one who comes across this thread later when conflicting answers are treated equally.  In the future, please do not award "participation" points to my answers.  I come from an era where we actually earned our trophies and this current trend of political correctness  is really offensive to me whereas I am not at all offended if you think someone else's idea is more appropriate for your situation or easier to implement and consequently don't award me any points at all.

Two people gave you suggestions relating to the subreport.  I told you that wouldn't work if you were trying to affect which projects were included in the report, Those solutions will filter the subreport but you will end up with projects that have no subreport.  Instead you needed to alter the main form query to control which projects were selected.  I could be wrong.  If so, then please tell us (and future readers) which solution actually did work for you.  Thanks