I'm trying to filter a subform with multiple combo boxes and eventually some text fields tied to one command button to execute the search/filter. I want the user to determine which filter or combination of filters to use.
I started with the combo boxes and can get one to work, however, when I add the second one I am forced to use both or an error is produced. The error is Runtime Error '2448' you can't assign a value to this object.
Here is a sample.
Private Sub cmdFilter_Click()
sfrm_Server_Data.Form.Filter = "Loc_ID=" & cboLoc.Value & _
"AND Cab_ID=" & cboCab.Value
sfrm_Server_Data.Form.FilterOn = True
End Sub
If I add a value in both combo boxes everthing works fine but I don't want to force the use of the second combo box.
How would I write this to allow for one or more filter selections tied to one command button?
Thanks,
Jim
I started with the combo boxes and can get one to work, however, when I add the second one I am forced to use both or an error is produced. The error is Runtime Error '2448' you can't assign a value to this object.
Here is a sample.
Private Sub cmdFilter_Click()
sfrm_Server_Data.Form.Filter = "Loc_ID=" & cboLoc.Value & _
"AND Cab_ID=" & cboCab.Value
sfrm_Server_Data.Form.FilterOn = True
End Sub
If I add a value in both combo boxes everthing works fine but I don't want to force the use of the second combo box.
How would I write this to allow for one or more filter selections tied to one command button?
Thanks,
Jim