G
Guest
OK, so I've got this Access form that has a print button on it. Essentially
the button is supposed to send the data specific to what's entered in the
form to a report. From there I hit the print button and away we go. Now, I
copied this database to another computer and suddently I get the following
error at random times:
Run-time error '2501':
The RunCommand action was canceled.
Now, here is the code I've used, without any troubles at all on my main
computer:
The line "DoCmd.RunCommand acCmdSave" is where the debugger takes me when I
get this error. I've tried searching on MS' Knowledgebase only to find some
info relating to Access 97. I'm using Access 2003. Again, this has worked
just fine from my computer. When I moved it to another, it gives this error.
Though it doesn't do it all the time.
Any ideas? Is my code just outdated code that I need to change? I'd gotten
the suggestion for this code from one of those Access help forums out there
but it's been a few years. I think at that point I developed the database on
either Access XP or else Access 2000. Thanks for any help you guys can offer!
the button is supposed to send the data specific to what's entered in the
form to a report. From there I hit the print button and away we go. Now, I
copied this database to another computer and suddently I get the following
error at random times:
Run-time error '2501':
The RunCommand action was canceled.
Now, here is the code I've used, without any troubles at all on my main
computer:
Private Sub cmdPrintRecord_Click()
Dim strReportName As String
Dim strCriteria As String
strReportName = "Printable_Returns_Form_rpt"
strCriteria = "[Return Number]=" & Me![Return Number]
DoCmd.RunCommand acCmdSave
Me.Requery
DoCmd.OpenReport strReportName, acViewPreview, , strCriteria
End Sub
The line "DoCmd.RunCommand acCmdSave" is where the debugger takes me when I
get this error. I've tried searching on MS' Knowledgebase only to find some
info relating to Access 97. I'm using Access 2003. Again, this has worked
just fine from my computer. When I moved it to another, it gives this error.
Though it doesn't do it all the time.
Any ideas? Is my code just outdated code that I need to change? I'd gotten
the suggestion for this code from one of those Access help forums out there
but it's been a few years. I think at that point I developed the database on
either Access XP or else Access 2000. Thanks for any help you guys can offer!