O
obzerbin
Hello...
In Access 2003 Project...
I have two subforms on a parent form. One of these has a combo box
for selecting the filter value, and a button for clearing the filter.
On the AfterUpdate event, the subform filters and then
programmatically filters the other subform, which works fine. When
the button is clicked, it removes the filter from the subform, and
clears the filter from the other subform programmatically, but I can't
get the other subform to show it's records.
'combo box filter code
Private Sub cmbCAMPUS_SLCT_AfterUpdate()
Dim strCurrFilter As String
Me.Filter = ""
Forms![frmRP_PROJ_MGR]![sfrmRP_PROJ_TASKS].Form.Filter = ""
If (Not IsNull(Me.cmbCAMPUS_SLCT)) Then
strCurrFilter = "(RTRIM([CAMPUS_NAME]) LIKE '%" &
RTrim(Me.cmbCAMPUS_SLCT) & "%')"
Me.Filter = strCurrFilter
Me.FilterOn = True
Forms![frmRP_PROJ_MGR]![sfrmRP_PROJ_TASKS].Form.Filter =
strCurrFilter
Forms![frmRP_PROJ_MGR]![sfrmRP_PROJ_TASKS].Form.FilterOn = True
End If
End Sub
'command button filter removal code
Private Sub cmdCLR_FLTR_Click()
Me.Filter = ""
Me.FilterOn = False
Me.cmbCAMPUS_SLCT = Null
Forms![frmRP_PROJ_MGR]![sfrmRP_PROJ_TASKS].Form.Filter = ""
Forms![frmRP_PROJ_MGR]![sfrmRP_PROJ_TASKS].Form.FilterOn = False
DoCmd.ShowAllRecords
End Sub
I have tried several variations on this including serverfilter
properties (but I have a Stored Procedure as the recordsource).
The filter lifts on Me. But not on the referenced subform.
The problem is somewhere in the command button code...or I am missing
the obvious or ???
Please help.
Hans
In Access 2003 Project...
I have two subforms on a parent form. One of these has a combo box
for selecting the filter value, and a button for clearing the filter.
On the AfterUpdate event, the subform filters and then
programmatically filters the other subform, which works fine. When
the button is clicked, it removes the filter from the subform, and
clears the filter from the other subform programmatically, but I can't
get the other subform to show it's records.
'combo box filter code
Private Sub cmbCAMPUS_SLCT_AfterUpdate()
Dim strCurrFilter As String
Me.Filter = ""
Forms![frmRP_PROJ_MGR]![sfrmRP_PROJ_TASKS].Form.Filter = ""
If (Not IsNull(Me.cmbCAMPUS_SLCT)) Then
strCurrFilter = "(RTRIM([CAMPUS_NAME]) LIKE '%" &
RTrim(Me.cmbCAMPUS_SLCT) & "%')"
Me.Filter = strCurrFilter
Me.FilterOn = True
Forms![frmRP_PROJ_MGR]![sfrmRP_PROJ_TASKS].Form.Filter =
strCurrFilter
Forms![frmRP_PROJ_MGR]![sfrmRP_PROJ_TASKS].Form.FilterOn = True
End If
End Sub
'command button filter removal code
Private Sub cmdCLR_FLTR_Click()
Me.Filter = ""
Me.FilterOn = False
Me.cmbCAMPUS_SLCT = Null
Forms![frmRP_PROJ_MGR]![sfrmRP_PROJ_TASKS].Form.Filter = ""
Forms![frmRP_PROJ_MGR]![sfrmRP_PROJ_TASKS].Form.FilterOn = False
DoCmd.ShowAllRecords
End Sub
I have tried several variations on this including serverfilter
properties (but I have a Stored Procedure as the recordsource).
The filter lifts on Me. But not on the referenced subform.
The problem is somewhere in the command button code...or I am missing
the obvious or ???
Please help.
Hans