E
Ed S.
I've got a database for a client that seems to be working perfectly on my
computer. The button is to open a report based upon which option is chosen.
However, when the client clicks on the button (and I've done this on her
laptop), she gets a message saying that the "Open Report Command Has been
cancelled."
Any ideas? I'm copying the programming below.
Thanks!
Private Sub btnPreviewReport_Click()
On Error GoTo Err_btnPreviewReport_Click
Dim stDocName As String
Dim stFilterName As String
'Define report based on option choice
If Me.grpReportList = 1 Then
stDocName = "lblBirthdays"
ElseIf Me.grpReportList = 2 Then
stDocName = "rptBirthdays"
ElseIf Me.grpReportList = 3 Then
stDocName = "rptClassAttendance"
ElseIf Me.grpReportList = 4 And Me.grpDivision = 1 Then
stDocName = "rptClassEnrollment"
ElseIf Me.grpReportList = 4 And Me.grpDivision = 2 Then
stDocName = "rptClassEnrollmentByDvision"
ElseIf Me.grpReportList = 5 Then
stDocName = "rptConfirmation"
ElseIf Me.grpReportList = 6 And Me.grpDivision = 1 Then
stDocName = "lblStudentsByClass"
ElseIf Me.grpReportList = 6 And Me.grpDivision = 2 Then
stDocName = "lblStudentsByClassByDivision"
ElseIf Me.grpReportList = 7 And Me.grpDivision = 1 Then
stDocName = "lblParents"
ElseIf Me.grpReportList = 7 And Me.grpDivision = 2 Then
stDocName = "lblParentsByDivision"
ElseIf Me.grpReportList = 8 Then
stDocName = "lblRecentMailingList"
ElseIf Me.grpReportList = 9 Then
stDocName = "rptMailingList"
ElseIf Me.grpReportList = 10 Then
stDocName = "rptRecommendations"
ElseIf Me.grpReportList = 11 Then
stDocName = "rptRegistrationForms"
ElseIf Me.grpReportList = 12 Then
stDocName = "rptEnrollmentStats"
ElseIf Me.grpReportList = 13 Then
stDocName = "rptStaffList"
ElseIf Me.grpReportList = 14 And Me.grpDivision = 1 Then
stDocName = "rptTShirtSize"
ElseIf Me.grpReportList = 14 And Me.grpDivision = 2 Then
stDocName = "rptTShirtSizeByDivision"
ElseIf Me.grpReportList = 15 Then
stDocName = "rptPrivacy"
ElseIf Me.grpReportList = 16 Then
stDocName = "rptDeletes"
Else: MsgBox "Please Choose A Report."
End If
'Open Report
DoCmd.OpenReport stDocName, acPreview
Exit_btnPreviewReport_Click:
Exit Sub
Err_btnPreviewReport_Click:
MsgBox Err.Description
Resume Exit_btnPreviewReport_Click
End Sub
computer. The button is to open a report based upon which option is chosen.
However, when the client clicks on the button (and I've done this on her
laptop), she gets a message saying that the "Open Report Command Has been
cancelled."
Any ideas? I'm copying the programming below.
Thanks!
Private Sub btnPreviewReport_Click()
On Error GoTo Err_btnPreviewReport_Click
Dim stDocName As String
Dim stFilterName As String
'Define report based on option choice
If Me.grpReportList = 1 Then
stDocName = "lblBirthdays"
ElseIf Me.grpReportList = 2 Then
stDocName = "rptBirthdays"
ElseIf Me.grpReportList = 3 Then
stDocName = "rptClassAttendance"
ElseIf Me.grpReportList = 4 And Me.grpDivision = 1 Then
stDocName = "rptClassEnrollment"
ElseIf Me.grpReportList = 4 And Me.grpDivision = 2 Then
stDocName = "rptClassEnrollmentByDvision"
ElseIf Me.grpReportList = 5 Then
stDocName = "rptConfirmation"
ElseIf Me.grpReportList = 6 And Me.grpDivision = 1 Then
stDocName = "lblStudentsByClass"
ElseIf Me.grpReportList = 6 And Me.grpDivision = 2 Then
stDocName = "lblStudentsByClassByDivision"
ElseIf Me.grpReportList = 7 And Me.grpDivision = 1 Then
stDocName = "lblParents"
ElseIf Me.grpReportList = 7 And Me.grpDivision = 2 Then
stDocName = "lblParentsByDivision"
ElseIf Me.grpReportList = 8 Then
stDocName = "lblRecentMailingList"
ElseIf Me.grpReportList = 9 Then
stDocName = "rptMailingList"
ElseIf Me.grpReportList = 10 Then
stDocName = "rptRecommendations"
ElseIf Me.grpReportList = 11 Then
stDocName = "rptRegistrationForms"
ElseIf Me.grpReportList = 12 Then
stDocName = "rptEnrollmentStats"
ElseIf Me.grpReportList = 13 Then
stDocName = "rptStaffList"
ElseIf Me.grpReportList = 14 And Me.grpDivision = 1 Then
stDocName = "rptTShirtSize"
ElseIf Me.grpReportList = 14 And Me.grpDivision = 2 Then
stDocName = "rptTShirtSizeByDivision"
ElseIf Me.grpReportList = 15 Then
stDocName = "rptPrivacy"
ElseIf Me.grpReportList = 16 Then
stDocName = "rptDeletes"
Else: MsgBox "Please Choose A Report."
End If
'Open Report
DoCmd.OpenReport stDocName, acPreview
Exit_btnPreviewReport_Click:
Exit Sub
Err_btnPreviewReport_Click:
MsgBox Err.Description
Resume Exit_btnPreviewReport_Click
End Sub