INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Run-time error '2489' on print

Run-time error '2489' on print

(OP)
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 

RE: Run-time error '2489' on print

Try stepping through the code to see which line causes the error.

RE: Run-time error '2489' on print

(OP)
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"

RE: Run-time error '2489' on print

(OP)
The full error I am getting is:

Run-time error '2489': The object 'rptPrint_ClaimTag_item' isn't open.

RE: Run-time error '2489' on print

(OP)
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 

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close