G
Guest
Hi,
I want to filter my subform using a combobox on my main form. I know how to
filter using VBA if all the combo boxes are on the same form, but I am not
yet VB-savvy enough to work out what the code would be to do the same thing
on a subform. If I was doing it all on the main form my code would read
Private Sub cmdApplyFilter_Click()
Me.Form.Filter = "[cboType] = '" & Me.cboFormType & "'"
Me.Form.FilterOn = True
End Sub
But that only works if [cboType] is on the main form, but it is instead a
field on my subform. My main form is called frmFormsSearchMAIN and my subform
is called frmFormsSearchSUB.
If anyone can tell me how to code this I would really appreciate it!
Thank you
I want to filter my subform using a combobox on my main form. I know how to
filter using VBA if all the combo boxes are on the same form, but I am not
yet VB-savvy enough to work out what the code would be to do the same thing
on a subform. If I was doing it all on the main form my code would read
Private Sub cmdApplyFilter_Click()
Me.Form.Filter = "[cboType] = '" & Me.cboFormType & "'"
Me.Form.FilterOn = True
End Sub
But that only works if [cboType] is on the main form, but it is instead a
field on my subform. My main form is called frmFormsSearchMAIN and my subform
is called frmFormsSearchSUB.
If anyone can tell me how to code this I would really appreciate it!
Thank you