View Full Version : filter problem


arage
09-10-2001, 12:53 PM
I created a report based on a query but must further restrict the report results. I’ve got 2 grouping levels & then in my detail section I tried inputing a series of if-then loops that verify what values are contained in the group & then exit the detail section if the record contains certain data.

My detail onFormat event was using a something like:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Dim x As Integer
x = Me.EventNumber
'BE...

If Me.PromotionType = "be" Then
If Me.ManagerName = "ken williams" Then
If (x < 3 Or x > 30) Then
Exit Sub
End If
End If
End If

But the above, plus minute variations on it do no good. ALL the records printed for each manager name includes every eventNumber not the ones I specify by my if-then criteria.

Pat Hartman
09-10-2001, 01:54 PM
You may have more success if you move the selection criteria to the query used as the report's recordsource.

arage
09-10-2001, 02:03 PM
ok this works better as query criteria but I’m trying to get it to work for more than just one true criteria (7)

IIf([PromotionType]="be" And [Manager]![Code]=1203,7 )

How might I get the equivalent of something like:

IIf([PromotionType]="be" And [Manager]![Code]=1203,7 and 14 and 15 ) ?