Open Report Cancelled

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
 
D

Daniel Pineault

There are numerous possible reasons, some more obvious than others

You may want to take a look at
http://www.devhut.net/index.php?lang=en&id=0000000005#err2501

You should also ensure that the report's page setup printer is set to
'Default Printer' and not a printer on your PC that the client will not have.

If none of these help then search this forum for your error code, you'll
find numerous postings that hopefully will help you isolate the problem.
--
Hope this helps,

Daniel Pineault
http://www.cardaconsultants.com/
For Access Tips and Examples: http://www.devhut.com/index.php
Please rate this post using the vote buttons if it was helpful.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top