Put filter in form header

svjensen

Registered User.
Local time
Today, 02:28
Joined
May 6, 2010
Messages
37
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
 
So what you're saying is you want to use oen form for searching and displaying the results?
 
Basically yes.
The idea was that the user could stay on one form and change the filter criteria.
I guess maybe subforms might do the trick. Would that be easier to do?
 
Yes, you're better off using subforms and having the search listboxes or combo boxes at the Header.

Or just use a continuous form. With this method you can follow the combobox wizard to link your subform to it.
 

Users who are viewing this thread

Back
Top Bottom