Filter to use with 2 combo boxes

nyk33

New member
Local time
Today, 12:24
Joined
Jul 10, 2002
Messages
6
Hi, I was wondering if someone could help me with this problem. I have a form with 2 combo boxes, 1 is named Categories and the other one is Product Part Number and I want to set a filter for the Category combo box, so when you select Heatsinks for example it only lists the heatsinks in the Product Part Number combo box. Then when you select the filtered Part Number I want it to go to that record. I have been stuck on this for a while now..... Thanks
 

Attachments

  • form.gif
    form.gif
    40.1 KB · Views: 172
For your first question, do a search on 'cascading combo'. You will find many threads treating that subject.
Ex:
Cascaded combos
Regarding the second, use the combo boxes wizard (make sure you have it installed, it may be optional when installing access). One of the proposed choices is to create a combo acting as a record selector. See how it works (it uses the Bookmard and RecordsetClone methods).
 
Last edited:
Hi Alexandre, I have checked the numerous posts and I am even more confused now since there seems to be many ways to approach this problem, I attached a pic of my table structure. Could you please tell me what I need to do based on that for the Categories combo box?

This is the code I have currently for the Categories combo box and it filters the records fine, only when I select the filtered record under Product Part Number do I get a Run Time Error 13 Type Mismatch

Private Sub Categories_AfterUpdate()
Me.Products.RowSource = "SELECT ProductPartNumber FROM" & _
" Products WHERE CategoryID = " & Me.Categories & _
" ORDER BY ProductPartNumber"
Me.Products = Me.Products.ItemData(0)
End Sub

Thanks!
 

Attachments

  • table.gif
    table.gif
    40.7 KB · Views: 168
Last edited:

Users who are viewing this thread

Back
Top Bottom