0
votes

I am using Access 2013. I have one table,A form and a query in database.

I am trying create query to filter data in table using form. I have added two fields(combobox) in form. Both are referencing different columns. And a button to trigger.

I am using this formula in Query for 'where' clause for one field(in Query)

[Forms]![frmDataEntry]![Transaction Type] Or IsNull([Forms]![frmDataEntry]![Transaction Type])

Its working fine if I select any value, its showing data matching that value.It's showing all records when I leave it blank.

But its not working if I add same formula(changing fieldname) for other parameter too.

Its showing correct data, if I select values for both comboboxes in form.But its showing blank dataset, If I ignore any combo box.

My expectation is:

If I select both values......It should filter matching both and get result. If I select none.............It should show all records. If I select only one.........It should filter based on only that column.

1
what is your formula with two parameters? because looks like you are on the right path. - Juan Carlos Oropeza

1 Answers

0
votes

You could use in your WHERE clause this

Like IIf(IsNull([Forms]![frmDataEntry]![Transaction Type]),"*" ,
               [Forms]![frmDataEntry]![Transaction Type])