G
Guest
I have a process button that is very easy that is not working. I want to be
able to have the user push one button to run reports. In the report there is
a field called "ViolationNumber" that will drive what report should be
pulled. Each number from 1-10 reflects a certain style of report. But when
I use the code below all it does is pull up the first report
"ViolationNotice" for all the reports. What am I missing:
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
able to have the user push one button to run reports. In the report there is
a field called "ViolationNumber" that will drive what report should be
pulled. Each number from 1-10 reflects a certain style of report. But when
I use the code below all it does is pull up the first report
"ViolationNotice" for all the reports. What am I missing:
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