G
Guest
I have (3) diffrent reports that are driven by a field called
"ViolationsNumber". I want to be able to run a string to have the reports
open by using that field. Can I go into the reports and set a filter on them
to have each number equal a report. For example;
1-Violation Notice
<=2 And >=3 - WRANotice
<=4 PenaltyNotice
How can I get this to work?
Here is a string that I created to run the report but all it does is open
the ViolationNotice report for all.
Private Sub CitationReports_Click()
Dim stDocNameViolationNotice As String
Dim stDocNameWRANotice As String
Dim stDocNamePenaltyNotice As String
stDocNameViolationNotice = "ViolationNotice"
stDocNameWRANotice = "WRANotice"
stDocNamePenaltyNotice = "PenaltyNotice"
If Number <= 1 Then
DoCmd.OpenReport stDocNameViolationNotice, acPreview
End If
If Number = 2 Then
DoCmd.OpenReport stDocNameWRANotice, acPreview
End If
If Number = 3 Then
DoCmd.OpenReport stDocNameWRANotice, acPreview
End If
If Number >= 4 Then
DoCmd.OpenReport stDocNamePenaltyNotice, acPreview
End If
End Sub
Thanks,
"ViolationsNumber". I want to be able to run a string to have the reports
open by using that field. Can I go into the reports and set a filter on them
to have each number equal a report. For example;
1-Violation Notice
<=2 And >=3 - WRANotice
<=4 PenaltyNotice
How can I get this to work?
Here is a string that I created to run the report but all it does is open
the ViolationNotice report for all.
Private Sub CitationReports_Click()
Dim stDocNameViolationNotice As String
Dim stDocNameWRANotice As String
Dim stDocNamePenaltyNotice As String
stDocNameViolationNotice = "ViolationNotice"
stDocNameWRANotice = "WRANotice"
stDocNamePenaltyNotice = "PenaltyNotice"
If Number <= 1 Then
DoCmd.OpenReport stDocNameViolationNotice, acPreview
End If
If Number = 2 Then
DoCmd.OpenReport stDocNameWRANotice, acPreview
End If
If Number = 3 Then
DoCmd.OpenReport stDocNameWRANotice, acPreview
End If
If Number >= 4 Then
DoCmd.OpenReport stDocNamePenaltyNotice, acPreview
End If
End Sub
Thanks,