2 combo boxes to update subform

helper11

Registered User.
Local time
Today, 17:13
Joined
Apr 10, 2010
Messages
40
Hi all,

I have 2 combo boxes, one for month and one for userid and I want to use them to filter the subforms. I was able to filter the subforms using a single combo, but I can not figure out how to get 2 of them to work. Here is the code I got the one to work if anyone needs something similar:

Private Sub Combo7_AfterUpdate()
Dim strF As String

If Not IsNull(Me.Combo7) Then
'assumes bound column in combo is the month number
strF = "UCase$(Left$(sku,3)) = """ & Me.Combo7 & """"
End If
Me.Alibrs_Sales.Form.Filter = strF
Me.Alibrs_Sales.Form.FilterOn = True
Me.Amazon_Sales.Form.Filter = strF
Me.Amazon_Sales.Form.FilterOn = True
Me.Sales.Form.Filter = strF
Me.Sales.Form.FilterOn = True


Thanks for any help on how to do this with 2 combo boxes..
 
Look at "DemoFilterMonthUserA2000.mdb" (attachment, zip).
Look at "Table1", "Query1", forms.
Open Form1 and try.
 

Attachments

Hello,

Thanks for the idea. I am trying to do it via 2 unattached combo boxes and then send it via a filter command, but I do not believe I can send 2 that way.

I am not sure how I would use a query to update the subforms from the main form after one or both combo boxes are selected. The filter way I can get one to work but not 2.

Any more ideas would be appreciated.

Andrew
 
Ok Look at "DemoSearchOR2A2000.mdb" (attachment, zip).
You don't need 2 forms for this. It's enough 1 form.
Look at Table, Query, Form. Open Form1 and try.
 

Attachments

Thanks a ton for the help. I got it working. You are the greatest....
 

Users who are viewing this thread

Back
Top Bottom