calc expression to filter a type

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

Guest

I have a resolution "type" field with 6 or 7 types.

I only want to show 3 on a report. I have this field in the query:

ResolutionFilter:=IIf([qryMediatorEvaluation]![ResolutionID]="Resolved Some
Issues","ResolutionID","") OR IIf([qryMediatorEvaluation]![ResolutionID]="No
Resolution","ResolutionID"," ") OR
IIf([qryMediatorEvaluation]![ResolutionID]="Full
Resolution","ResolutionID","")

It doesn't filter the field in data sheet view. I see all the records not
just those with the 3 types.
tia,
 
I have a resolution "type" field with 6 or 7 types.

I only want to show 3 on a report. I have this field in the query:

ResolutionFilter:=IIf([qryMediatorEvaluation]![ResolutionID]="Resolved Some
Issues","ResolutionID","") OR IIf([qryMediatorEvaluation]![ResolutionID]="No
Resolution","ResolutionID"," ") OR
IIf([qryMediatorEvaluation]![ResolutionID]="Full
Resolution","ResolutionID","")

It doesn't filter the field in data sheet view. I see all the records not
just those with the 3 types.
tia,

What's qryMediatorEvaluation? The source for the report?

If you only want to show those three values, pass a filter when you
open the report. Something like:

DoCmd.OpenReport "rptMediatorEvaluation", "[ResolutionID] IN
('Resolved Some
Issues', 'No Resolution', 'Full Resolution')

Private Sub cmdOpenFilteredReport_Click()
On Error GoTo Err_cmdOpenFilteredReport_Click

Dim stDocName As String
Dim strFilter As String
strFilter = "[ResolutionID] IN ('Resolved', Some Issues', 'No
Resolution', 'Full Resolution')"
stDocName = "rptMediatorEvaluation"
DoCmd.OpenReport stDocName, acPreview, , strFilter

Watch the wrap... the whole DoCmd.OpenReport goes on a single line.

If you look on http://www.mvps.org/access/ (Access Web), you'll find
several articles about filtering reports...
(Not like that goofy thing that FMP used to do where you had to run a
filter/sort and then save your script)... basically here you can
specify it when you open the report.
 

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

Back
Top