Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Filtering Subform From Navigation Form

Status
Not open for further replies.

Boots6

Technical User
Aug 12, 2011
91
US
Hello,
I have a combo box with values "OPEN", "REVISED", " ", etc on a subform of a navigation form. I've tried to nail down the syntax to get to it from the navigation form, but have had so much trouble getting it right. I've tried to use Me.ActiveControl to get around the problem and it still didn't work. I tried to do Screen.ActiveForm.ActiveControl as well. There is some problem getting the subform to filter.

Here is the code for the subform
If Screen.ActiveForm.ActiveControl = " " Then
DoCmd.RunCommand acCmdRemoveFilterSort
End If
If Screen.ActiveForm.ActiveControl = "OPEN" Then
DoCmd.ApplyFilter "STATUS_O", "", ""
End If
If Screen.ActiveForm.ActiveControl = "REVISED" Then
DoCmd.ApplyFilter "STATUS_R", "", ""
End If
If Screen.ActiveForm.ActiveControl = "COST IMPACT" Then
DoCmd.ApplyFilter "C_IMPACT", "", ""
End If
If Screen.ActiveForm.ActiveControl = "SCHEDULE IMPACT" Then
DoCmd.ApplyFilter "S_IMPACT", "", ""
End If

End Function

Navigation Form Name: PROJECT_MAIN
PROJECT_MAIN Record Source: PROJECT
Subform Container Name: Navigation Subform
Name of Tab Control to get to RFI Subform: RFI_NAV
Navigation Target Name: RFII_LOG
Combo Box name: FILTERRFI

I realize I have some inconsistent labeling going on, but I'm working on it :) I would really appreciate any insight on running that filter. Thanks!
 
Something like this ?
If Forms!PROJECT_MAIN![Navigation Subform].Form!FILTERRFI = "OPEN" Then

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
That's it! Thank you much. Now, however, it is asking for Parameter Values when I select the items in the combo box. If I have the navigation subform correct, it's like it can't find the fields on the original form.

I tried messing with the WHERE statement, but it's not working.

It says ApplyFilter requires a valid control name that corresponds to a subform or report. Any idea what I might be doing wrong? The Status control is an Option Group control called STATUS with 3 options. I'm using 1 for OPEN and 3 for REVISED.

The Cost & Schedule Impacts are just check boxes.

Thanks again :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top