Error when printing reports while running MDE but not MDF

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • matt753
    New Member
    • May 2010
    • 91

    Error when printing reports while running MDE but not MDF

    This problem only occurs when running from the MDE file, works perfectly fine when trying it from the original MDF.

    I have a command button that prints a report, except after pressing it, a error comes up: "The expression On Click you entered as the event property setting produced the following error:The OpenReport action was cancelled."

    Does anyone have any idea what this could be from?
  • missinglinq
    Recognized Expert Specialist
    • Nov 2006
    • 3533

    #2
    If you need help in trouble-shooting code, it's a good idea to actually post the code!

    Linq ;0)>

    Comment

    • DataAnalyzer
      New Member
      • May 2010
      • 15

      #3
      Could the report not have data? Do you trap the NoData event in the report?

      Comment

      • matt753
        New Member
        • May 2010
        • 91

        #4
        Heres the code:

        Code:
        Dim rs As Recordset
            
            Set rs = frmsubAdminEdit.Form.Recordset
            
            rs.MoveFirst
            Do Until rs.EOF
            
                If rs(7) > 0 Then
                
                    DoCmd.OpenReport "rptInvoice", acViewNormal, , "OrderID=" & rs(0), , False
                    rs.Edit
                    rs(6) = -1
                    rs.Update
                
                End If
                
                rs.MoveNext
            
            Loop
            
            Set rs = Nothing
        Again, error when clicking this button happens only when the front end is a MDE, works fine when its a MDB. Error is: "The expression On Click you entered as the event property setting produced the following error:The OpenReport action was cancelled."

        Comment

        • matt753
          New Member
          • May 2010
          • 91

          #5
          The report DOES have data in it

          Comment

          • matt753
            New Member
            • May 2010
            • 91

            #6
            Any ideas anyone?

            Has anyone else ever had weird issues that only happen in an MDE and not the MDB?

            Comment

            • DataAnalyzer
              New Member
              • May 2010
              • 15

              #7
              What's the error code? Looks like a NoData problem to me when you try to open the report. Does the NoData event trigger in the report when you run this? A simple MsgBox would be able to tell you.

              Comment

              • matt753
                New Member
                • May 2010
                • 91

                #8
                It was actually due to an error in the code I had when the report was opening. It just didnt show that when doing it in this loop. Only when opened indiviudally.

                Comment

                Working...