Open various reports with a Calendar

Charlee

New member
Local time
Today, 14:07
Joined
Sep 11, 2015
Messages
2
Access 2007

I am trying to open 3 Reports. I used this code and it works very well with two reports, but I dont't know how to do with 3 reports. Here is my code:

Private Sub PreviewReport_Click()
On Error GoTo Err_PreviewReport_Click

Dim stDocName As String
If FrameDetails.Value = 1 Then
stDocName = "ProcessedNODetails"
Else
stDocName = "ProcessedDetails"
End If

DoCmd.OpenReport stDocName, acPreview

Exit_PreviewReport_Click:
Exit Sub

Err_PreviewReport_Click:
MsgBox Err.Description
Resume Exit_PreviewReport_Click

End Sub
 
Use ElseIf or change to Select/Case. I'd lean towards Select/Case but that's more of a personal preference.
 
Thank you so much
 
No problem and welcome to the site by the way. Post back if you have trouble implementing. I'm not sure why your posts have been moderated, but it should resolve itself.
 

Users who are viewing this thread

Back
Top Bottom