M
markmarko
Hello,
So, I've got a form that's linked to many tables. I'm trying to make a
couple filtering controls.
So far, I've got a combo box that lists the possible filter methods (by
account#, Customer name, etc). Depending on which selection is made, it shows
a textbox(es) to enter filter criteria. For this question, let's assume user
selects Filter By Account #.
The Account# control on the form is called AccountNumber. The text box that
the user types into for filtering is called Filter-Account#.
Then there's a "Apply Filter" button. On Click, this calls a macro which
first ShowsAllRecords (to remove previous filters (not sure I need this, but
it seems so)). Then it applies a filter, depending on what has been selected
in the combo box, in this case Account#.
As a start, let's assume Filter by Account # is chosen. The macro then
performs Apply Filter, with WHERE
[AccountNumber]=[Forms]![Entry-SalesOrderTabbed]![Filter-Account#]
When I test it, it asks for the parameter Filter-Account#. I can't
understand why it can't see it. It's copy/pasted, so know it's not mistyped.
I've also tried it using a query instead of the WHERE, that seems to sort
the first time, but any subsequent filters use the orignal Filter-Account#,
regardless of what is currently typed into it.
Any advice is greatly appreciated!
So, I've got a form that's linked to many tables. I'm trying to make a
couple filtering controls.
So far, I've got a combo box that lists the possible filter methods (by
account#, Customer name, etc). Depending on which selection is made, it shows
a textbox(es) to enter filter criteria. For this question, let's assume user
selects Filter By Account #.
The Account# control on the form is called AccountNumber. The text box that
the user types into for filtering is called Filter-Account#.
Then there's a "Apply Filter" button. On Click, this calls a macro which
first ShowsAllRecords (to remove previous filters (not sure I need this, but
it seems so)). Then it applies a filter, depending on what has been selected
in the combo box, in this case Account#.
As a start, let's assume Filter by Account # is chosen. The macro then
performs Apply Filter, with WHERE
[AccountNumber]=[Forms]![Entry-SalesOrderTabbed]![Filter-Account#]
When I test it, it asks for the parameter Filter-Account#. I can't
understand why it can't see it. It's copy/pasted, so know it's not mistyped.
I've also tried it using a query instead of the WHERE, that seems to sort
the first time, but any subsequent filters use the orignal Filter-Account#,
regardless of what is currently typed into it.
Any advice is greatly appreciated!