Filtering

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

Guest

I have a field called "Status" and what I would like is when I open the form
I would like it to show me ALL RECORDS except for those that have the Status
= "Closed".

How can I do this?

Ty
 
set the query (upon which your form is based) to only show records that
aren't closed.

In the criteria for the "status" field put...


Not "Closed"


Hope that helps,
Rick B
 
Ty said:
I have a field called "Status" and what I would like is when I open
the form I would like it to show me ALL RECORDS except for those that
have the Status = "Closed".

How can I do this?

Ty

Some of the time or all of the time? If the former open the form while
applying a filter with...

DoCmd.OpenForm "FormName",,,,"Status = 'Closed'"

If the latter, base the form on a query and apply criteria to the query that
only reurns the records you want.

The big difference is with the first option it is a simple matter to remove
or change the filter to see the records with a different status value. With
the latter it would be a bit more involved, but still possible.
 
I am confused - I want it when I double click on my FORM "Site Information" I
would like to be able to turn it on or off - most of the time it will be OFF.

Thanks.

Ty
 
Ty said:
I am confused - I want it when I double click on my FORM "Site
Information" I would like to be able to turn it on or off - most of
the time it will be OFF.

For a filter that is easily removed you need to run some code to apply the
filter. This rules out being able to open the form just by double-clicking in
the db window unless you put the code in the form's Open event

Me.Filter = "Status = 'Closed'"
Me.FilterOn = True

With the above code in the form's Open event it would open with the filter
applied, but once open you could use the menu or toolbar to change or remove the
filter.
 
Rick - great idea !!! Thank you.

The only problem is you said:

Me.Filter = "Status = 'Closed'"
Me.FilterOn = True

This is causing only my Closed Statuses to show up - I want it to show
everything, BUT, the Closed Statuses.

What do I use instead of "=" - is there a NOT EQUAL symbol?

Thanks.

Ty
 
Ty said:
Rick - great idea !!! Thank you.

The only problem is you said:

Me.Filter = "Status = 'Closed'"
Me.FilterOn = True

This is causing only my Closed Statuses to show up - I want it to show
everything, BUT, the Closed Statuses.

What do I use instead of "=" - is there a NOT EQUAL symbol?

<>
 
Back
Top