Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run-time error '2489' on print

Status
Not open for further replies.

Denae

Instructor
Apr 15, 2016
29
US
I have a form that has the following code on the AfterUpdate property, it is printing an ID Label for the record that has just been added. The label prints but then Access gives me the Run-time error. Any help would be greatly appreciated.

Code:
Private Sub Form_AfterUpdate()

DoCmd.OpenReport "rptPrint_ClaimTag_Item", acViewNormal
DoCmd.SelectObject acReport, "rptPrint_ClaimTag_Item"
DoCmd.PrintOut acPrintAll
DoCmd.Close acReport, "rptPrint_ClaimTag_Item"

End Sub

I tried turning off Echo and Warnings but I still received the error.
Code:
Private Sub Form_AfterUpdate()

Application.Echo False
DoCmd.SetWarnings False
DoCmd.Hourglass True

DoCmd.OpenReport "rptPrint_ClaimTag_Item", acViewNormal
DoCmd.SelectObject acReport, "rptPrint_ClaimTag_Item"
DoCmd.PrintOut acPrintAll
DoCmd.Close acReport, "rptPrint_ClaimTag_Item"

DoCmd.Hourglass False
DoCmd.SetWarnings False
Application.Echo True


End Sub
 
It is not letting me step through, it does nothing when I select this option. When I click Debug it highlights the line:
DoCmd.SelectObject acReport, "rptPrint_ClaimTag_Item"
 
The full error I am getting is:

Run-time error '2489': The object 'rptPrint_ClaimTag_item' isn't open.
 
I got it to work by simplifying, it is always the little things that get me:

Code:
Private Sub Form_AfterUpdate()

DoCmd.OpenReport "rptPrint_ClaimTag_Item", acViewNormal
DoCmd.Close acReport, "rptPrint_ClaimTag_Item"

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top