Full Version: How to filter both true and false statement
UtterAccess Forums > Microsoft® Access > Access Forms
kidmon
i m doing a command button that require to filter both true and false statement but i do not know how to filter both and only can filter 1
Can anyone teach me what is the code for filtering both true and false
Private Sub cmdTrackATP_Click()
Me.Filter = "Forms!frmWIP!ATPCheck = True"
Me.Filter = "Forms!frmWIP!PreCheck = False"
Me.Filter = "Forms!frmWIP!A5Check = False"
Me.Filter = "Forms!frmWIP!SorCheck = False"
Me.Filter = "Forms!frmWIP!DownCheck = False"
Me.Filter = "Forms!frmWIP!BackCheck = False"
Me.Filter = "Forms!frmWIP!Sor2Check = False"
Me.Filter = "Forms!frmWIP!FQACheck = False"
Me.FilterOn = True
this only can filter for true
but if i want to filter both true and false then the
<code> Me.FilterOn =
should equal to what?
bigdutch
Your Me.Filter can consist of multiple criteria but in your posted code each subsequent line re-writes Me.Filter with a new value ? You first line should be
e.Filter = "Forms!frmWIP!ATPCheck = True"
then the second
Me.Filter = (Me.Filter + " AND ") "Forms!frmWIP!PreCheck = False"
And the third
Me.Filter = (Me.Filter + " AND ") "Forms!frmWIP!A5Check = False"
This will then give you more than 1 filter term.
In terms of having both true/false statements of course is possible but getting those statemens from your form i`m not clear how you will do this ?
Steve Schapel
Kidman,
irst of all, I don't think it makes sense to include a reference to a control on a form in a Filter statement.
Secondly, the general gist of your code doesn't really make sense... you are setting the value of the Filter property, and then in the next line setting it to something else, which overrides the previous.
Third, you seem to be misunderstanding the meaning of the FilterOn property. This controls whether the filter defined in the Filter property is actually applied to the form's data or not.
So I think the best thing is if you can give some details, with examples, of what you are really trying to achieve here.
kidmon
my problem is cause there is all this check and there is bout 1000 data store and this form is a precess form
so i want a command button to check till which level some of the data stop and each check is 1 level.
but if i only do filter the true only that means all will appear but i only wanted the 1st check only to appear
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.