Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Filter Subform Using Many ComboBoxes

Status
Not open for further replies.

dmkennard2

Technical User
Jun 11, 2004
101
GB
Hi,
I have a problem with filtering a subform based on many comboboxes.

I can filter using one Combobox using this code:

Private Sub cmbAisle_AfterUpdate()
Me.qryAllData_subform.Form.Filter = "[Aisle]='" & Me.[cmbAisle] & "'"
Me.qryAllData_subform.Form.FilterOn = True

End Sub

But when i add the same code the the next Comboboxes:

Private Sub cmbAisle_AfterUpdate()

Me.qryAllData_subform.Form.Filter = "[Aisle]='" & Me.[cmbAisle] & "'"
Me.qryAllData_subform.Form.FilterOn = True

End Sub

Private Sub cmbSide_AfterUpdate(Cancel As Integer)

Me.qryAllData_subform.Form.Filter = "[Side]='" & Me.[cmbSide] & "'"
Me.qryAllData_subform.Form.FilterOn = True

End Sub

Private Sub cmbLocation_AfterUpdate(Cancel As Integer)

Me.qryAllData_subform.Form.Filter = "[Location]='" & Me.[cmbLocation] & "'"
Me.qryAllData_subform.Form.FilterOn = True

End Sub

I get the error:
"Procedure declaration does not match description of event or procedure having the same name"

Am i missing something?

Thanks in advance
Dazz
 
Where is (Cancel As Integer) coming from ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Oh wahat a muppet i am. Thanks fella.

Can i make the subform filter on each selection? It's only filtering on the last combo selected at the moment.

Thanks
Dazz
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top