I have been using two forms, to allow my user to filter the data which is presented.
In order to do this I built a query, which picked all the needed data from relevant tables, and based the main form on this query.
The user was then first presented with a filter form on which there are two lists. The user then chooses which criteria he wants displayed (on both lists multiple selections are allowed).
The main form is then loaded using:
DoCmd.OpenForm frmMainForm, , , strWhere
with strWhere being the selected criteria.
This works well.
I am, however, looking to put the filter directly on the main form (in the form header). But I have been unable to get it to work so far.
My first question would be, if I should still base the form on my query, or if I should load the data using VBA instead?
And if I use the query, how do I apply the criteria (lists are named lstStatus and lstType).
I hope that I have made myself clear
/Soren
In order to do this I built a query, which picked all the needed data from relevant tables, and based the main form on this query.
The user was then first presented with a filter form on which there are two lists. The user then chooses which criteria he wants displayed (on both lists multiple selections are allowed).
The main form is then loaded using:
DoCmd.OpenForm frmMainForm, , , strWhere
with strWhere being the selected criteria.
This works well.
I am, however, looking to put the filter directly on the main form (in the form header). But I have been unable to get it to work so far.
My first question would be, if I should still base the form on my query, or if I should load the data using VBA instead?
And if I use the query, how do I apply the criteria (lists are named lstStatus and lstType).
I hope that I have made myself clear

/Soren