Filter subform on main form from search criteria on other form

C

celineusa

Hi all!

Here is my situation:
I have a main form (students) that contains a subform
(quartersattending). Those two are linked by StudentID.
I created a form that will allow the user to search for the database
(last name, first name, address, major, quarter attending, classes
taken,...). To do that, I use different queries, depending on the
choices selected (if there is only choices made from the Students
table, then I created a query that queries only the students table, if
some quarterattending is selected, then I created a query that queries
the students table and the [students and quarters] table,...)
The user can chose to output the results to an excel file, a report or
a filtered students form. Everything works perfectly when I chose to
output my results to a report or excel file. Moreover, when the user
choses to output the results to the filtered Students form, if there is
only criteria chosen from the students table (no quarterattending, no
major, no classes selected), it uses the basic query involving only the
students table, and the filtered Students form works perfectly.
Now if I chose to filter depending on quarterattending (or major, or
classes), then it uses one of the INNER JOIN queries and the students
form doesn't get filtered anymore: it asks me to enter the parameter
for [Students and Quarters].quarterID (or [students and
majors].majorID,...).
Here is part of my code:

DoCmd.OpenForm "Students", acNormal, strSQL
strSQL being the query used.

I hope it's not too confusing. I'll be glad to give more details!

Thanks for any help!
Celine
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top