AllExperts > Using MS Access 
Search      
Using MS Access
Volunteer
Answers to thousands of questions
 Home · More Using MS Access Questions · Answer Library  · Encyclopedia ·
More Using MS Access Answers
Question Library

Ask a question about Using MS Access
Volunteer
Experts of the Month
Expert Login

Awards

About Us
Tell friends
Link to Us
Disclaimer

 
 
 
 
About Richard Rost
Expertise
I am happy to answer any kinds of questions about Microsoft Access - from basic table design to advanced VBA programming. Also, please feel free to check the Access Tips & Tricks section of my web site.

Experience
I am the president of AccessLearningZone.com and 599CD.com. I specialize in Microsoft Access Tutorials. I have been teaching Access in the classroom since 1994, and online since 2002.

Education/Credentials
I am a self-taught Access expert. I have been building databases for clients since the early 90s. You can see a sample of my Access Tutorials on my web site at 599CD.com

 
   

You are here:  Experts > Computing/Technology > Business Software > Using MS Access > Filtering subreport to a record that is using the same table as the parent report

Using MS Access - Filtering subreport to a record that is using the same table as the parent report


Expert: Richard Rost - 7/9/2009

Question
Hello, I have a pretty complex problem and I hope it possible to even achieve.  Basically I have a form set up with 2 combo boxes, a cboFrom and a cboTo, the values in these combo boxes come from the same table, they're product codes.  Each product code has some settings with it so the table is set up as:
Product code (key), Setting 1, Setting 2, Setting 3 etc...

I then want to set it up so just by clicking a button it will print a report with the values in the cboTo print on the parent report, while the values for the cboFrom will print in the subreport.  Is this possible? I know how to filter the parent report, but I can't figure out how to filter a subreport at the same time.  They're taking from the same table, just different records.

What I want to do, essentially is just display 2 rows, a FROM with their settings and a TO next to it.  Would this be possible?

My level is intermediate, I can do coding and I understand it pretty well but I am completely dumb in queries, I've only used them very basically.

Thank you very much in advance!

Answer
I wouldn't use a filter. Just set up two queries - one based on each of those combo boxes - then use those queries for your reports.

See:

If you want to refer to a value on a Form, you can use the notation:

Forms!FormName!FieldName

You can use this notation inside of queries, other forms, or even reports. I have a free tutorial that explains how to use this:

http://599cd.com/tips/access/forms-formname-field-notation?key=AllExperts

Note that if you're refering to a value on a SUBFORM, the correct notation is:

Forms!FormName!SubForm.Form!FieldName

Crazy, I know. Enjoy! Hope this helps.

Let me know if you have any other questions or comments.

Also, be sure to visit my web site and watch my FREE 90-minute MICROSOFT ACCESS VIDEO TUTORIAL. Go to http://www.599cd.com/Access/AllExperts


Cordially,

Richard Rost
599CD Computer Training
http://www.599cd.com

P.S. Also, don't forget to visit my FREE Microsoft Access Tips & Tricks Page at http://www.599cd.com/Tips/AllExperts

P.P.S. I volunteer my time at AllExperts to help people, and I get a LOT of questions, so I can't take an hour to answer each question. If you need more DETAILED HELP, come to my TechHelp web site at http://www.599cd.com/TechHelp/AllExperts and I'll take as much time as you need to answer your question.

http://www.599cd.com/Microsoft_Access_Tutorial?key=AllExperts

Out of work? Know someone who is? Get a FREE copy of my Computer Job Skills CD at http://www.599cd.com/JobSkills?key=AllExperts

Add to this Answer   Ask a Question


 
User Agreement | Privacy Policy | Kids' Privacy Policy | Help
Copyright  © 2008 About, Inc. AllExperts, AllExperts.com, and About.com are registered trademarks of About, Inc. All rights reserved.