Form With Option to Filter or Not

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.
 
S

Steve Schapel

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]
 
G

Guest

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.
 
S

Steve Schapel

Don,

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top