Limit Sub Form records based on Main Form

B

BEETHOVEN

I have an option group called Issue_Type on my main form
F1_Member_Demographics_Main. When I select one of the 3 options on the
main form from the option group Issue_Type I want to limit the sub
form F2_Member_Issues records based on the combo box Issue_Code_T1.

Option Group Issue_Type on main form:
1=Complaint
2=Grievance
3=Appeal

Combo Box on sub form:
1=Complaint
2=Grievance
3=Appeal

So if I select Complaint from the option group on the main form I only
want to see Complaints on the sub form etc.

Below is some code that someone gave me. I have limited knowledge on using
code. I put the code in the After Update
on the option group Issue_Type but I still get all the records on the subform:

Forms!F1_Member_Demographics_Main!F2_Member_Issues.Form.Filter = _
"Issue_Code_T1 = " & Me.Issue_Type
Forms!F1_Member_Demographics_Main!F2_Member_Issues.Form.Filter = True
Forms.F1_Member_Demographics_Main.F2_Member_Issues.Form.Requery

Any suggestions
Thanks
Gary
 
N

NKTower

Ohhh, so close!

I think you want to add two letters - "On" as in

Forms!F1_Member_Demographics_Main!F2_Member_Issues.Form.FilterOn = True


Which tells Access to honor the setting of the filter. I suspect that the
subsquent Requery line is redundant, I think setting FilterOn = TRUE (or
FALSE) will cause a Requery.
 

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