Form With Option to Filter or Not

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form “Expense Items†which I want to open either filtered or not
filtered. I have a combo box “cboExpItems†on my switchboard where the names
of individuals can be selected to show only the expense items they have
entered. When a person selects their name I want an “AfterUpdate†event to
run the macro titled “ExpFormSelPers†which I am wanting to refer back to the
combo box to filter on. I am not using a query.
The macro info is as follows:
Name: ExpFormSelPers
Action: OpenForm
Form Name: Expense Items
Where Condition: [ExpenseItems]![RequestedBy]=[Forms]![Main Switchboard]!
[cboExpItems]

I don’t want two forms to maintain so I am also wanting to run this form
with no filter so I can see all entries for everyone. To do this I plan on
having a simple command button that opens the form directly.

As always thanks for your help.
 
Don,

Sounds like a fine scheme. Is there a problem? Did you try it yet? I
would say the Where Condition argument probably needs some work. I
would suggest:
[Forms]![Expense Items]![RequestedBy]=[cboExpItems]
 
I put in your suggestion but I am having the same problem as before. I get a
parameter box asking me to enter the value for cboExpItems. I then added the
additional identifier as follows [Forms]![Main Switchboard]![cboExpItems] but
with the same result. Thanks

Steve Schapel said:
Don,

Sounds like a fine scheme. Is there a problem? Did you try it yet? I
would say the Where Condition argument probably needs some work. I
would suggest:
[Forms]![Expense Items]![RequestedBy]=[cboExpItems]

--
Steve Schapel, Microsoft Access MVP
I have a form “Expense Items†which I want to open either filtered or not
filtered. I have a combo box “cboExpItems†on my switchboard where the names
of individuals can be selected to show only the expense items they have
entered. When a person selects their name I want an “AfterUpdate†event to
run the macro titled “ExpFormSelPers†which I am wanting to refer back to the
combo box to filter on. I am not using a query.
The macro info is as follows:
Name: ExpFormSelPers
Action: OpenForm
Form Name: Expense Items
Where Condition: [ExpenseItems]![RequestedBy]=[Forms]![Main Switchboard]!
[cboExpItems]

I don’t want two forms to maintain so I am also wanting to run this form
with no filter so I can see all entries for everyone. To do this I plan on
having a simple command button that opens the form directly.

As always thanks for your help.
 
Don,

The most likely explanation is a spelling error. Please check that
cboExpItems is the precise name of the combobox.
 
Back
Top