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!
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!