HI All,
I have a main form (frmIncRetEstimates) with three combo boxes and a SubForm sfrmEstimateLogSummary) that opens in Datasheet view and is linked by the Link Master Field and its Link Child Field
The SubForm when opened on its own has a filter and the Filter On Load is set to Yes.
I created the Main form and dragged the subform and linked each of the combo boxes to their respective field. There's a couple of things going on, all related to the filtering.
1. When I open the main form, the subform doesn't display any information.
2. When I click the combo box that has a value list on it, the table filters itself (Station or LIne)
3. When I click the combo box that has a query in the rowsource, although I can make a selection, the subform won't filter until I make a selection on the combo with the value list
3. The third button will populate the combo box but won't allow me to actually make the selection.
I have two other buttons to re-filter:
Reset button should display the subform filtered on the current user only
Show All button should remove all filters and show all records
I've attached my database for reference
I have a main form (frmIncRetEstimates) with three combo boxes and a SubForm sfrmEstimateLogSummary) that opens in Datasheet view and is linked by the Link Master Field and its Link Child Field
The SubForm when opened on its own has a filter and the Filter On Load is set to Yes.
I created the Main form and dragged the subform and linked each of the combo boxes to their respective field. There's a couple of things going on, all related to the filtering.
1. When I open the main form, the subform doesn't display any information.
2. When I click the combo box that has a value list on it, the table filters itself (Station or LIne)
3. When I click the combo box that has a query in the rowsource, although I can make a selection, the subform won't filter until I make a selection on the combo with the value list
3. The third button will populate the combo box but won't allow me to actually make the selection.
I have two other buttons to re-filter:
Reset button should display the subform filtered on the current user only
Show All button should remove all filters and show all records
Code:
Private Sub cmdReset_Click()
Dim ctl As Control
For Each ctl In Me.Section(acHeader).Controls
If ctl.Name Like "cbo&" Then
Select Case ctl.ControlType
Case acTextBox, acComboBox
ctl.Value = Null
Case acCheckBox
ctl.Value = False
End Select
End If
Next ctl
Me.sfrmEstimateLog.Form.Filter = "[Requestbyperson] = '" & ResolveCurrentUserName & "'"
Me.sfrmEstimateLog.Form.FilterOn = True
End Sub
Code:
Private Sub cmdShowAll_Click()
Me.sfrmEstimateLog.Form.FilterOn = False
Me.sfrmEstimateLog.Form.Filter = ""
End Sub
I've attached my database for reference