Quick filter-criterium For Report

  • Thread starter Thread starter Steven Taub
  • Start date Start date
S

Steven Taub

What kind of data are you going to be filtering on? Are
they specific fields every time?
 
Two kinds of fields as you describe them. One such as an Account number
where an exact match will be available to the user. This would be known to
the user.

This is the one I am most concerned with at this time.

Other times will require more of a find by alpha. They would need to
have a little help here as often they may not know the exact spelling or
possible abbreviations that might have been used. I have used various
tricks in the past, but they take a little more time than I have now or will
have for several other projects coming up.

Typically there would be between a few hundred to a few hundred thousand
records.
 
One way to do this is to open a "Pre-Processor" Form when the user wants to
run a Report. On this Form, put a ComboBox (or ListBox) presenting the
easy-to-remember data on the AccountNos (e.g. full names rather than
AccountNo / abbreviated codes only) so that the user can select an AccountNo
via the full names. Remember to use the AccountNo as the BoundColumn of the
ComboBox / ListBox. Also, put 2 CommandButtons for previewing and printing
the Report, both using the OpenReport Method.

In the OpenReport Method, use the "wherecondition" argument to filter the
Report to the AccountNo selected in the ComboBox or ListBox. Alternatively,
you can base the Report on a Parameter Query with the full reference to the
ComboBox / ListBox as the Parameter.

Check Access VB Help on the OpenReport Method for the "wherecondition".
 
Thanks for the suggestions. They were not exactly what I was hoping
for but I did use them and they saved me a few hours of work today and I did
get the project done on time. I'll work on getting it the way it should
really be done (not that your way or what I was hoping for are wrong, only
they are not the best for this project) next week.
 
I am not sure what you want but develop from the same concept. You can make
the "Pre-Processor" Form as complex as you need, e.g. TextBoxes for the user
to type in for certain text to be searched for, ComboBoxes and ListBoxes for
the user to select from limited set of values, etc ...

Of corse, the more the user specifies, the more complex the "wherecondition"
construction will become.

--
HTH
Van T. Dinh
MVP (Access)



news:[email protected]...
 
Back
Top