Hi all, I'm going to try to be as specific as possible, but due to the content of the database, I can't provide an actual copy.
The ultimate goal here is to filter the subform's records by the combo box on the main form.
I have a main form, FrmInput.
On it there is a combo box, CmbCat.
The source for cmbCat is a table containing the options "All" and possible contents of a column in the subform's recordset.
The subform is control named SubDocs.
The subform itself is named subFrmDocumentation.
The subform control is sitting on a page control named PgDocumentation.
Now, I've tried several methods, but the current one I've been attempting is as follows:
I've set the Filter on subFrmDocumentation to: Cat = [Forms]![FrmInput]![CmbCat]
Then on form load for FrmInput I do: SubDocs.Form.FilterOn = False
and: CmbCat.value = "All"
Then for changing values on CmbCat:
Private Sub CmbCat_Change()
If Me.CmbCat.Value = "All" Then
SubDocs.Form.FilterOn = False
Else
SubDocs.Form.FilterOn = True
End If
End Sub
This reads to me that the subform should be filtered by CmbCat whenever CmbCat is not "All". However, whenever the value of CmbCat is changed, the subform's data all dissappears (it still exists in the tables thankfully), leaving just the column headers. I've tried changing the recordset and changing the filter itself rather than just turning it on and off, and both have had the same result. Could someone point out what I'm doing wrong?
Thanks in advance.