Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Apply filter condition in query

Status
Not open for further replies.

CHTHOMAS

Programmer
Jun 16, 1999
106
AE
Hi,

I have a form on which there are 4 combo boxes. Office, Department, Employment type and function. The purpose of these combo boxes is to apply filter to form data. I have created a Macro to apply filter. Infact its a lot of if..then..conditions checking for which combo box has value and not. Is there a way to put the criteria in the form query so that i can eliminate the macro and apply filter to the form?
 
Hiya,

My personal opinion is that you eliminate macros altogether and apply VBA.

You have 4 combos, they (via user selection) determine what data the form displays.

If I as a developer want to know what the criteria is; it'll take me 10 times longer to determine what a macro is doing as opposed to a simple, clearly displayed piece of VBA code.

It's especially clear and useful with IF..ELSE..ENDIF statements and if you have more than 2 or 3, then you have the option of the CASE statement which makes it all the clearer.

Anyway, your question.....

How can you apply a filter to a form, when the form itself supplies information FROM THE USER that determines the filter information?

The form is there to enable the user to enter the filter info. is it not?

Or have I got it wrong?

Regards,

Darrylle "Never argue with an idiot, he'll bring you down to his level - then beat you with experience."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top