Help.. Parameter Query using a combo box in a form

jhoelesmejarda

Registered User.
Local time
Today, 18:19
Joined
Jan 10, 2013
Messages
26
Hi everyone,

I have a form with a main form and a subform, main form's function is to filter the data's inside the sub form using a combo box, right now I have one combo box which filters the data according to their control no so the output if I use say CtrlNo 1 in the combo box the data that will reflect in the subform would be the data's of CtrlNo 1 but now I'm planning to add another combo box that will filter who supplied that CtrlNo, what I did is I used the same method from my first form that filters the CtrlNo but in this form I replaced the CtrlNo combo box to Supplier Combo box it worked great but now what it made me think is it possible to put this two filters in just one form?combo box 1 is for CtrlNo combo box 2 is for Supplier, when I tried to create this it failed, when I filtered only the CtrlNo subform doesn't reflect any data this goes the same for the Supplier combo box but when I tried to choose a filter for both combo box say CtrlNo 1 and its Supplier this works fine but what I want is to have both filters to work even if I did not use both parameters is there any way to achieve this? I am very new to access and wanted to learn more. Thank in advance
 
I am guessing from your post that you have a query that references both combos and that you want to filter by either or both,

The approach is

(Field1= refcombo1 or refcombo1 is null) and (Field2= refcombo2 or refcombo2 is null)

Refcombo is forms!formname!Comboname

Brian
 
My bad.. Actually the combo box filter was made from a look up. I made a query first, create a form out of that query then attached it to the main form that has a look up value (the combo box) that will filter the data in that sub form.
 

Users who are viewing this thread

Back
Top Bottom