What is the meaning or impact of ‘Filter’ in the property sheet of a form (1 Viewer)

SachAccess

Active member
Local time
Today, 21:38
Joined
Nov 22, 2021
Messages
389
Hi,
I have an existing MS Access file with me.
There are couple of forms in this file.
In one of the form, I checked property sheet of the form.
In ‘Filter’, Policy = 'CM-00001' and Case_ID in (1234,1235,1236,1237,1238,1239,1240) this is mentioned.
I am not able to understand purpose of this statement in filter and its impact.
Is it required or what does it actually does on the form.
Not able to see these values on the form when I open the form.
Can anyone please help me in this.
 

bob fitz

AWF VIP
Local time
Today, 17:08
Joined
May 23, 2011
Messages
4,727
It's the criteria used if the form is filter is applied.
Is the form's Filter On Load property set to Yes or No
 

SachAccess

Active member
Local time
Today, 21:38
Joined
Nov 22, 2021
Messages
389
It's the criteria used if the form is filter is applied.
Is the form's Filter On Load property set to Yes or No
Hi @bob fitz thanks for the help. On Load property is set to 'No' on the form.
Have a nice day ahead. :)
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 17:08
Joined
Sep 12, 2006
Messages
15,657
You can apply a filter in the query to only show records in a certain data range., for instance, but the FORM fllter would be blank.

when you view the form you can interact with the form, and filter the records displayed. You could select a single customer, or a single product for instance. If you right-click any field/text box, you will see sort and filter options. So if you apply a filter here, that will be stored in the form properties. It's possible that the filter doesn't get cleared when you close the form, so bear in mind that there might be a "hidden" filter preventing you seeing some records.
 

SachAccess

Active member
Local time
Today, 21:38
Joined
Nov 22, 2021
Messages
389
Hi @gemma-the-husky thanks for the help. Please correct me if am wrong.
Does this mean, if I remove the filter from the form properties, it will show me all the records including if any hidden.
So ideally, if do not want to hide any records with specific purpose then filter value in the properties should be blank.
Have a nice day ahead. :)
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 17:08
Joined
Sep 12, 2006
Messages
15,657
It should show you all of the records in the query or table that is the forms record source. Offhand, the navigation buttons at the bottom will show the position within the recordset. Eg 48 of 223

I believe if the display is filtered, that message will show filtered somewhere. So 24 of 112 (filtered).
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 11:08
Joined
Feb 28, 2001
Messages
27,187
A form's .Filter property is like putting a new sub-clause in the form's .Recordsource WHERE clause. Setting .FilterOnLoad = TRUE means the filter will be applied during the form's .OnLoad event. Or you can define the .Filter using VBA and dynamically turn it on with .FilterOn = TRUE

 

MajP

You've got your good things, and you've got mine.
Local time
Today, 12:08
Joined
May 21, 2018
Messages
8,529
There are two properties that work in tandem

.Filter
a SQL where clause without the word "where"

.FilterOn
True applies the filter, False turns it off

When you turn FilterOn to false it does not clear the filter property. This then allows you to toggle the filter on and off and remember what you were filtering. So sometimes you may see something in the Filter property and nothing seems to be filtered.
 

SachAccess

Active member
Local time
Today, 21:38
Joined
Nov 22, 2021
Messages
389
A form's .Filter property is like putting a new sub-clause in the form's .Recordsource WHERE clause. Setting .FilterOnLoad = TRUE means the filter will be applied during the form's .OnLoad event. Or you can define the .Filter using VBA and dynamically turn it on with .FilterOn = TRUE

Thanks for the help @The_Doc_Man have a nice day ahead. :)
Thanks for the help @gemma-the-husky , have a nice day ahead. :)
Thanks for the help @MajP , have a nice day ahead. :)
I agree with you @MajP 'So sometimes you may see something in the Filter property and nothing seems to be filtered' on this.
 

Users who are viewing this thread

Top Bottom