Form Filter by default

R

René

I currently have forms for my employee and client information run directly off the respective tables.

Is there a way to have the default set in such a way that when the form loads, the form automatically filters to Active employees and clients. There is a status field. and if someone wanted to see all records, ie past or present employees etc all that they would have to do is click the funnel to remove the filter?

I've played around with no success, must not be playing on the right playground.
 
A

Arvin Meyer

Certainly. Create a query with "active" as the criteria. Use the query as
the record source of the form.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access

René said:
I currently have forms for my employee and client information run directly off the respective tables.

Is there a way to have the default set in such a way that when the form
loads, the form automatically filters to Active employees and clients.
There is a status field. and if someone wanted to see all records, ie past
or present employees etc all that they would have to do is click the funnel
to remove the filter?
 
F

fredg

René said:
I currently have forms for my employee and client information run
directly off the respective tables.

Is there a way to have the default set in such a way that when the form
loads, the form automatically filters to Active employees and clients.
There is a status field. and if someone wanted to see all records, ie
past or present employees etc all that they would have to do is click
the funnel to remove the filter?

I've played around with no success, must not be playing on the right playground.

Code the Form's Open event:
Me.Filter = "Status = True"
Me.FilterOn = True

The above assumes status is a Check Box (True/False), and True
represents Active.

If Status is Text then use
Me.Filter = "Status = 'Active'"

Notice the use of single quotes around Active.
 

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